diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..463a134 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + release: + types: [created] + +jobs: + release: + runs-on: macos-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '2.7' # Specify the Ruby version you are using + + - name: Install CocoaPods + run: gem install cocoapods + + - name: Validate podspec + run: pod lib lint --allow-warnings + + - name: Push to CocoaPods trunk + env: + COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} + run: pod trunk push RadarSDKMotion.podspec --allow-warnings \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7801c93..e6211dc 100644 --- a/.gitignore +++ b/.gitignore @@ -66,3 +66,7 @@ fastlane/test_output # https://github.com/johnno1962/injectionforxcode iOSInjectionProject/ + + +.DS_Store +RadarSDKMotion/.DS_Store \ No newline at end of file diff --git a/RadarSDKMotion.podspec b/RadarSDKMotion.podspec new file mode 100644 index 0000000..0ed2c72 --- /dev/null +++ b/RadarSDKMotion.podspec @@ -0,0 +1,15 @@ +Pod::Spec.new do |s| + s.name = 'RadarSDKMotion' + s.version = '0.0.1' + s.summary = 'Motion detection plugin for RadarSDK, the leading geofencing and location tracking platform' + s.homepage = 'https://radar.com' + s.author = { 'Radar Labs, Inc.' => 'support@radar.com' } + s.platform = :ios + s.source = { :git => 'https://github.com/radarlabs/radar-sdk-ios-motion.git', :tag => s.version.to_s } + s.source_files = ["RadarSDKMotion/RadarSDKMotion/*.{h,m}"] + s.module_name = 'RadarSDKMotion' + s.ios.deployment_target = '12.0' + s.frameworks = 'CoreMotion' + s.requires_arc = true + s.license = { :type => 'Apache-2.0' } +end diff --git a/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj new file mode 100644 index 0000000..37402cd --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.pbxproj @@ -0,0 +1,503 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + E6F3D4202C5977DC009C8D08 /* RadarSDKMotion.docc in Sources */ = {isa = PBXBuildFile; fileRef = E6F3D41F2C5977DC009C8D08 /* RadarSDKMotion.docc */; }; + E6F3D4262C5977DC009C8D08 /* RadarSDKMotion.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E6F3D41B2C5977DC009C8D08 /* RadarSDKMotion.framework */; }; + E6F3D42B2C5977DC009C8D08 /* RadarSDKMotionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E6F3D42A2C5977DC009C8D08 /* RadarSDKMotionTests.swift */; }; + E6F3D42C2C5977DC009C8D08 /* RadarSDKMotion.h in Headers */ = {isa = PBXBuildFile; fileRef = E6F3D41E2C5977DC009C8D08 /* RadarSDKMotion.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E6F3D4362C597D77009C8D08 /* RadarSDKMotion.m in Sources */ = {isa = PBXBuildFile; fileRef = E6F3D4352C597D77009C8D08 /* RadarSDKMotion.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + E6F3D4272C5977DC009C8D08 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E6F3D4122C5977DC009C8D08 /* Project object */; + proxyType = 1; + remoteGlobalIDString = E6F3D41A2C5977DC009C8D08; + remoteInfo = RadarSDKMotion; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + E6F3D41B2C5977DC009C8D08 /* RadarSDKMotion.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RadarSDKMotion.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E6F3D41E2C5977DC009C8D08 /* RadarSDKMotion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RadarSDKMotion.h; sourceTree = ""; }; + E6F3D41F2C5977DC009C8D08 /* RadarSDKMotion.docc */ = {isa = PBXFileReference; lastKnownFileType = folder.documentationcatalog; path = RadarSDKMotion.docc; sourceTree = ""; }; + E6F3D4252C5977DC009C8D08 /* RadarSDKMotionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RadarSDKMotionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + E6F3D42A2C5977DC009C8D08 /* RadarSDKMotionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RadarSDKMotionTests.swift; sourceTree = ""; }; + E6F3D4352C597D77009C8D08 /* RadarSDKMotion.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RadarSDKMotion.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E6F3D4182C5977DC009C8D08 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6F3D4222C5977DC009C8D08 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E6F3D4262C5977DC009C8D08 /* RadarSDKMotion.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + E6F3D4112C5977DC009C8D08 = { + isa = PBXGroup; + children = ( + E6F3D41D2C5977DC009C8D08 /* RadarSDKMotion */, + E6F3D4292C5977DC009C8D08 /* RadarSDKMotionTests */, + E6F3D41C2C5977DC009C8D08 /* Products */, + ); + sourceTree = ""; + }; + E6F3D41C2C5977DC009C8D08 /* Products */ = { + isa = PBXGroup; + children = ( + E6F3D41B2C5977DC009C8D08 /* RadarSDKMotion.framework */, + E6F3D4252C5977DC009C8D08 /* RadarSDKMotionTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + E6F3D41D2C5977DC009C8D08 /* RadarSDKMotion */ = { + isa = PBXGroup; + children = ( + E6F3D41E2C5977DC009C8D08 /* RadarSDKMotion.h */, + E6F3D4352C597D77009C8D08 /* RadarSDKMotion.m */, + E6F3D41F2C5977DC009C8D08 /* RadarSDKMotion.docc */, + ); + path = RadarSDKMotion; + sourceTree = ""; + }; + E6F3D4292C5977DC009C8D08 /* RadarSDKMotionTests */ = { + isa = PBXGroup; + children = ( + E6F3D42A2C5977DC009C8D08 /* RadarSDKMotionTests.swift */, + ); + path = RadarSDKMotionTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + E6F3D4162C5977DC009C8D08 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + E6F3D42C2C5977DC009C8D08 /* RadarSDKMotion.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + E6F3D41A2C5977DC009C8D08 /* RadarSDKMotion */ = { + isa = PBXNativeTarget; + buildConfigurationList = E6F3D42F2C5977DC009C8D08 /* Build configuration list for PBXNativeTarget "RadarSDKMotion" */; + buildPhases = ( + E6F3D4162C5977DC009C8D08 /* Headers */, + E6F3D4172C5977DC009C8D08 /* Sources */, + E6F3D4182C5977DC009C8D08 /* Frameworks */, + E6F3D4192C5977DC009C8D08 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RadarSDKMotion; + productName = RadarSDKMotion; + productReference = E6F3D41B2C5977DC009C8D08 /* RadarSDKMotion.framework */; + productType = "com.apple.product-type.framework"; + }; + E6F3D4242C5977DC009C8D08 /* RadarSDKMotionTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = E6F3D4322C5977DC009C8D08 /* Build configuration list for PBXNativeTarget "RadarSDKMotionTests" */; + buildPhases = ( + E6F3D4212C5977DC009C8D08 /* Sources */, + E6F3D4222C5977DC009C8D08 /* Frameworks */, + E6F3D4232C5977DC009C8D08 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + E6F3D4282C5977DC009C8D08 /* PBXTargetDependency */, + ); + name = RadarSDKMotionTests; + productName = RadarSDKMotionTests; + productReference = E6F3D4252C5977DC009C8D08 /* RadarSDKMotionTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E6F3D4122C5977DC009C8D08 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1540; + LastUpgradeCheck = 1540; + TargetAttributes = { + E6F3D41A2C5977DC009C8D08 = { + CreatedOnToolsVersion = 15.4; + }; + E6F3D4242C5977DC009C8D08 = { + CreatedOnToolsVersion = 15.4; + }; + }; + }; + buildConfigurationList = E6F3D4152C5977DC009C8D08 /* Build configuration list for PBXProject "RadarSDKMotion" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E6F3D4112C5977DC009C8D08; + productRefGroup = E6F3D41C2C5977DC009C8D08 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E6F3D41A2C5977DC009C8D08 /* RadarSDKMotion */, + E6F3D4242C5977DC009C8D08 /* RadarSDKMotionTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E6F3D4192C5977DC009C8D08 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6F3D4232C5977DC009C8D08 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E6F3D4172C5977DC009C8D08 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6F3D4202C5977DC009C8D08 /* RadarSDKMotion.docc in Sources */, + E6F3D4362C597D77009C8D08 /* RadarSDKMotion.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E6F3D4212C5977DC009C8D08 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E6F3D42B2C5977DC009C8D08 /* RadarSDKMotionTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + E6F3D4282C5977DC009C8D08 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E6F3D41A2C5977DC009C8D08 /* RadarSDKMotion */; + targetProxy = E6F3D4272C5977DC009C8D08 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + E6F3D42D2C5977DC009C8D08 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + E6F3D42E2C5977DC009C8D08 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + E6F3D4302C5977DC009C8D08 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 96GHH65B9D; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 14.5; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotion; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = auto; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E6F3D4312C5977DC009C8D08 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 96GHH65B9D; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + LD_RUNPATH_SEARCH_PATHS = ( + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = ( + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 14.5; + MARKETING_VERSION = 1.0; + MODULE_VERIFIER_SUPPORTED_LANGUAGES = "objective-c objective-c++"; + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu17 gnu++20"; + PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotion; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = auto; + SKIP_INSTALL = YES; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_INSTALL_OBJC_HEADER = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + E6F3D4332C5977DC009C8D08 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 96GHH65B9D; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + MACOSX_DEPLOYMENT_TARGET = 14.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotionTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E6F3D4342C5977DC009C8D08 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 96GHH65B9D; + GENERATE_INFOPLIST_FILE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 17.5; + MACOSX_DEPLOYMENT_TARGET = 14.5; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = RadarLabs.RadarSDKMotionTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx"; + SWIFT_EMIT_LOC_STRINGS = NO; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E6F3D4152C5977DC009C8D08 /* Build configuration list for PBXProject "RadarSDKMotion" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6F3D42D2C5977DC009C8D08 /* Debug */, + E6F3D42E2C5977DC009C8D08 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E6F3D42F2C5977DC009C8D08 /* Build configuration list for PBXNativeTarget "RadarSDKMotion" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6F3D4302C5977DC009C8D08 /* Debug */, + E6F3D4312C5977DC009C8D08 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E6F3D4322C5977DC009C8D08 /* Build configuration list for PBXNativeTarget "RadarSDKMotionTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E6F3D4332C5977DC009C8D08 /* Debug */, + E6F3D4342C5977DC009C8D08 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = E6F3D4122C5977DC009C8D08 /* Project object */; +} diff --git a/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.docc/RadarSDKMotion.md b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.docc/RadarSDKMotion.md new file mode 100755 index 0000000..a051ab9 --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.docc/RadarSDKMotion.md @@ -0,0 +1,13 @@ +# ``RadarSDKMotion`` + +Summary + +## Overview + +Text + +## Topics + +### Group + +- ``Symbol`` \ No newline at end of file diff --git a/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.h b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.h new file mode 100644 index 0000000..b0aadec --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.h @@ -0,0 +1,39 @@ +// +// RadarSDKMotion.h +// RadarSDKMotion +// +// Created by Kenny Hu on 7/30/24. +// + +#import +#import + +//! Project version number for RadarSDKMotion. +FOUNDATION_EXPORT double RadarSDKMotionVersionNumber; + +//! Project version string for RadarSDKMotion. +FOUNDATION_EXPORT const unsigned char RadarSDKMotionVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + +// Define the interface for export +@interface RadarSDKMotion : NSObject + + +- (void)stopActivityUpdates; +- (void)startActivityUpdatesToQueue: (NSOperationQueue *)queue withHandler : (CMMotionActivityHandler)handler; + +- (void)startAccelerometerUpdates; +- (CMAccelerometerData *)getAccelerometerData; +- (void)stopAccelerometerUpdates; +- (void)startGyroUpdates; +- (CMGyroData *)getGyroData; +- (void)stopGyroUpdates; +- (void)startMagnetometerUpdates; +- (CMMagnetometerData *)getMagnetometerData; +- (void)stopMagnetometerUpdates; + +@end + + diff --git a/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.m b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.m new file mode 100644 index 0000000..607a1b3 --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotion/RadarSDKMotion.m @@ -0,0 +1,80 @@ +// +// RadarSDKMotion.m +// RadarSDKMotion +// +// Created by Kenny Hu on 7/30/24. +// + +#import "RadarSDKMotion.h" + +@interface RadarSDKMotion () + +@property (nonatomic, strong) CMMotionActivityManager *activityManager; +@property (nonatomic, strong) CMMotionManager *motionManager; + +@end + +@implementation RadarSDKMotion + +- (instancetype)init { + self = [super init]; + if (self) { + _activityManager = [[CMMotionActivityManager alloc] init]; + _motionManager = [[CMMotionManager alloc] init]; + } + return self; +} + +- (void)stopActivityUpdates { + [self.activityManager stopActivityUpdates]; +} + +- (void)startActivityUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMMotionActivityHandler)handler { + if ([CMMotionActivityManager isActivityAvailable]) { + [self.activityManager startActivityUpdatesToQueue:queue withHandler:handler]; + } +} + +- (void)startAccelerometerUpdates { + if (self.motionManager.isAccelerometerAvailable) { + [self.motionManager startAccelerometerUpdates]; + } +} + +- (CMAccelerometerData *)getAccelerometerData { + return self.motionManager.accelerometerData; +} + +- (void)stopAccelerometerUpdates { + [self.motionManager stopAccelerometerUpdates]; +} + +- (void)startGyroUpdates { + if (self.motionManager.isGyroAvailable) { + [self.motionManager startGyroUpdates]; + } +} + +- (CMGyroData *)getGyroData { + return self.motionManager.gyroData; +} + +- (void)stopGyroUpdates { + [self.motionManager stopGyroUpdates]; +} + +- (void)startMagnetometerUpdates { + if (self.motionManager.isMagnetometerAvailable) { + [self.motionManager startMagnetometerUpdates]; + } +} + +- (CMMagnetometerData *)getMagnetometerData { + return self.motionManager.magnetometerData; +} + +- (void)stopMagnetometerUpdates { + [self.motionManager stopMagnetometerUpdates]; +} + +@end diff --git a/RadarSDKMotion/RadarSDKMotionTests/RadarSDKMotionTests.swift b/RadarSDKMotion/RadarSDKMotionTests/RadarSDKMotionTests.swift new file mode 100644 index 0000000..1cbe8d6 --- /dev/null +++ b/RadarSDKMotion/RadarSDKMotionTests/RadarSDKMotionTests.swift @@ -0,0 +1,36 @@ +// +// RadarSDKMotionTests.swift +// RadarSDKMotionTests +// +// Created by Kenny Hu on 7/30/24. +// + +import XCTest +@testable import RadarSDKMotion + +class RadarSDKMotionTests: XCTestCase { + + override func setUpWithError() throws { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDownWithError() throws { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + // Any test you write for XCTest can be annotated as throws and async. + // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error. + // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards. + } + + func testPerformanceExample() throws { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +}