react-native-background-geolocation 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/stale.yml +41 -0
- package/CHANGELOG.md +1131 -0
- package/LICENSE +22 -0
- package/README.md +292 -0
- package/RNBackgroundGeolocation.podspec +27 -0
- package/android/.idea/compiler.xml +22 -0
- package/android/.idea/copyright/profiles_settings.xml +3 -0
- package/android/.idea/encodings.xml +6 -0
- package/android/.idea/gradle.xml +12 -0
- package/android/.idea/misc.xml +4 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/runConfigurations.xml +12 -0
- package/android/RNBackgroundGeolocation.iml +119 -0
- package/android/android.iml +20 -0
- package/android/app.gradle +22 -0
- package/android/build.gradle +62 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.aar +0 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.aar.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.aar.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.aar.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.aar.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.pom +9 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.pom.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.pom.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.pom.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/3.1.33/tslocationmanager-3.1.33.pom.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml +14 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.aar +0 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.aar.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.aar.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.aar.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.aar.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.pom +9 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.pom.md5 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.pom.sha1 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.pom.sha256 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/3.1.33/tslocationmanager-reverse-3.1.33.pom.sha512 +1 -0
- package/android/libs/com/transistorsoft/tslocationmanager-reverse/maven-metadata.xml +14 -0
- package/android/proguard-rules.pro +30 -0
- package/android/react-native-background-geolocation-android.iml +229 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/HeadlessTask.java +171 -0
- package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocation.java +33 -0
- package/android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocationModule.java +1261 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/ios/RNBackgroundGeolocation/RNBackgroundGeolocation.h +22 -0
- package/ios/RNBackgroundGeolocation/RNBackgroundGeolocation.m +754 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/Info.plist +57 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/AtomicBoolean.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/ConfigModule.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/HttpRequest.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/HttpResponse.h +29 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/LocationManager.h +55 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/LogQuery.h +13 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/SOMotionDetector.h +140 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/SQLQuery.h +34 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +16 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSAuthorization.h +37 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSCallback.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSConfig.h +304 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +43 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSDeviceInfo.h +24 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +15 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSGeofence.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSGeofenceEvent.h +60 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSGeofenceManager.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSHttpEvent.h +19 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSHttpService.h +58 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSLocation.h +101 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSLocationManager.h +312 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +14 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +20 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSReachability.h +106 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSSchedule.h +40 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSScheduleEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +41 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +31 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Info.plist +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/Modules/module.modulemap +6 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_armv7/TSLocationManager.framework/TSLocationManager +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/AtomicBoolean.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/ConfigModule.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/HttpRequest.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/HttpResponse.h +29 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/LocationManager.h +55 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/LogQuery.h +13 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/SOMotionDetector.h +140 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/SQLQuery.h +34 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +16 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorization.h +37 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSCallback.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSConfig.h +304 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +43 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSDeviceInfo.h +24 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +15 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofence.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceEvent.h +60 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceManager.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpEvent.h +19 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpService.h +58 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSLocation.h +101 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSLocationManager.h +312 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +14 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +20 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSReachability.h +106 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSSchedule.h +40 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSScheduleEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +41 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +31 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Info.plist +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/Modules/module.modulemap +6 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/TSLocationManager +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeResources +612 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_i386_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeSignature +0 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/AtomicBoolean.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/ConfigModule.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpRequest.h +21 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpResponse.h +29 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LocationManager.h +55 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LogQuery.h +13 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/SOMotionDetector.h +140 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/SQLQuery.h +34 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSActivityChangeEvent.h +16 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorization.h +37 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorizationEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCallback.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSConfig.h +304 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h +43 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSDeviceInfo.h +24 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h +15 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofence.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceEvent.h +60 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceManager.h +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h +17 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHeartbeatEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpEvent.h +19 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpService.h +58 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocation.h +101 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocationManager.h +312 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h +14 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSProviderChangeEvent.h +20 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSReachability.h +106 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSSchedule.h +40 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSScheduleEvent.h +18 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSWatchPositionRequest.h +41 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h +31 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Modules/module.modulemap +6 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Info.plist +50 -0
- package/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager +0 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/project.pbxproj +341 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/xcshareddata/RNBackgroundGeolocation.xccheckout +41 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/xcuserdata/chris.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/Build.xcscheme +80 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/RNBackgroundGeolocation.xcscheme +113 -0
- package/ios/RNBackgroundGeolocation.xcodeproj/xcuserdata/chris.xcuserdatad/xcschemes/xcschememanagement.plist +37 -0
- package/ios/RNBackgroundGeolocationTests/Info.plist +24 -0
- package/package.json +54 -0
- package/react-native.config.js +20 -0
- package/scripts/cp-declarations +53 -0
- package/scripts/declare-module +3 -0
- package/scripts/docs-index.html +4 -0
- package/scripts/generate-docs +23 -0
- package/scripts/postlink.js +146 -0
- package/scripts/postunlink.js +128 -0
- package/scripts/tsconfig.json +21 -0
- package/scripts/xcode-helpers.js +171 -0
- package/src/DeviceSettings.js +52 -0
- package/src/Events.js +17 -0
- package/src/Logger.js +90 -0
- package/src/NativeModule.js +528 -0
- package/src/TransistorAuthorizationToken.js +73 -0
- package/src/declarations/BackgroundGeolocation.d.ts +1601 -0
- package/src/declarations/interfaces/Authorization.d.ts +156 -0
- package/src/declarations/interfaces/AuthorizationEvent.d.ts +30 -0
- package/src/declarations/interfaces/Config.d.ts +2437 -0
- package/src/declarations/interfaces/ConnectivityChangeEvent.d.ts +18 -0
- package/src/declarations/interfaces/CurrentPositionRequest.d.ts +45 -0
- package/src/declarations/interfaces/DeviceInfo.d.ts +33 -0
- package/src/declarations/interfaces/DeviceSettings.d.ts +223 -0
- package/src/declarations/interfaces/Geofence.d.ts +255 -0
- package/src/declarations/interfaces/GeofenceEvent.d.ts +30 -0
- package/src/declarations/interfaces/GeofencesChangeEvent.d.ts +22 -0
- package/src/declarations/interfaces/HeartbeatEvent.d.ts +20 -0
- package/src/declarations/interfaces/HttpEvent.d.ts +313 -0
- package/src/declarations/interfaces/Location.d.ts +216 -0
- package/src/declarations/interfaces/LocationAuthorizationAlert.d.ts +41 -0
- package/src/declarations/interfaces/Logger.d.ts +359 -0
- package/src/declarations/interfaces/MotionActivityEvent.d.ts +31 -0
- package/src/declarations/interfaces/MotionChangeEvent.d.ts +15 -0
- package/src/declarations/interfaces/Notification.d.ts +484 -0
- package/src/declarations/interfaces/PermissionRationale.d.ts +31 -0
- package/src/declarations/interfaces/ProviderChangeEvent.d.ts +74 -0
- package/src/declarations/interfaces/SQLQuery.d.ts +60 -0
- package/src/declarations/interfaces/Sensors.d.ts +31 -0
- package/src/declarations/interfaces/State.d.ts +51 -0
- package/src/declarations/interfaces/TransistorAuthorizationToken.d.ts +63 -0
- package/src/declarations/interfaces/WatchPositionRequest.d.ts +45 -0
- package/src/declarations/types.d.ts +170 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +822 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
echo "Analytics ID: $GA_ID"
|
|
4
|
+
|
|
5
|
+
#typedoc --out docs --includeDeclarations --excludeExternals --listInvalidSymbolLinks --name "React Native Background Geolocation" --theme ./node_modules/typedoc-theme-transistor/src/default --mode file --gaID $GA_ID --gaSite "auto" ./src/declarations/
|
|
6
|
+
|
|
7
|
+
typedoc --out docs \
|
|
8
|
+
--tsconfig ./scripts/tsconfig.json \
|
|
9
|
+
--excludeExternals \
|
|
10
|
+
--listInvalidSymbolLinks \
|
|
11
|
+
--readme none \
|
|
12
|
+
--name "React Native Background Geolocation" \
|
|
13
|
+
--theme node_modules/\@transistorsoft/typedoc-theme/bin/default \
|
|
14
|
+
--highlightTheme monokai \
|
|
15
|
+
--gaID $GA_ID \
|
|
16
|
+
--gaSite "auto" \
|
|
17
|
+
--plugin ./node_modules/\@transistorsoft/typedoc-theme/node_modules/\@transistorsoft/typedoc-plugin-mediaplayer \
|
|
18
|
+
--plugin ./node_modules/\@transistorsoft/typedoc-theme/node_modules/\@transistorsoft/typedoc-plugin-gitlink \
|
|
19
|
+
--plugin ./node_modules/\@transistorsoft/typedoc-theme/node_modules/typedoc-plugin-merge-modules \
|
|
20
|
+
./src/declarations/
|
|
21
|
+
|
|
22
|
+
touch ./docs/.nojekyll
|
|
23
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const xcode = require('xcode');
|
|
6
|
+
const PbxFile = require('xcode/lib/pbxFile');
|
|
7
|
+
const helpers = require('./xcode-helpers');
|
|
8
|
+
|
|
9
|
+
const projectDirectory = process.cwd();
|
|
10
|
+
const moduleDirectory = path.resolve(__dirname, '..');
|
|
11
|
+
|
|
12
|
+
////
|
|
13
|
+
// iOS
|
|
14
|
+
//
|
|
15
|
+
const sourceDirectory = path.join(projectDirectory, 'ios');
|
|
16
|
+
const xcodeProjectDirectory = helpers.findProject(sourceDirectory);
|
|
17
|
+
|
|
18
|
+
const projectConfig = {
|
|
19
|
+
sourceDir: sourceDirectory,
|
|
20
|
+
pbxprojPath: path.join(
|
|
21
|
+
projectDirectory,
|
|
22
|
+
'ios',
|
|
23
|
+
xcodeProjectDirectory,
|
|
24
|
+
'project.pbxproj'
|
|
25
|
+
),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const pathToFramework = path.relative(
|
|
29
|
+
projectConfig.sourceDir,
|
|
30
|
+
path.join(
|
|
31
|
+
moduleDirectory,
|
|
32
|
+
'ios',
|
|
33
|
+
'RNBackgroundGeolocation',
|
|
34
|
+
'TSLocationManager.framework'
|
|
35
|
+
)
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
const project = xcode.project(projectConfig.pbxprojPath).parseSync();
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* There is a method in node-xcode that offers similar functionality than what
|
|
43
|
+
* is implemented below `addFramework` (https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L300)
|
|
44
|
+
* but unfortunately it won't work for our use-case because there are two other
|
|
45
|
+
* methods in node-xcode that are being used by `addFramework` that don't work
|
|
46
|
+
* as expected:
|
|
47
|
+
* 1 `addToFrameworksPbxGroup` fails if no group with the name "Frameworks" exists
|
|
48
|
+
* https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L641
|
|
49
|
+
* - https://github.com/alunny/node-xcode/issues/43
|
|
50
|
+
* - this issue could be worked around by just checking if the group exists and
|
|
51
|
+
* creating it if it doesn't exist before executing `addFramework`
|
|
52
|
+
* 2 `addToFrameworkSearchPaths` doesn't work with react-native:
|
|
53
|
+
* https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L1125
|
|
54
|
+
* - https://github.com/alunny/node-xcode/issues/91
|
|
55
|
+
* - https://github.com/alunny/node-xcode/pull/99
|
|
56
|
+
* - the issue there is that https://github.com/alunny/node-xcode/blob/ffb938b/lib/pbxProject.js#L1133
|
|
57
|
+
* in react-native projects the "PRODUCT_NAME" is "$(TARGET_NAME)", so it won't
|
|
58
|
+
* be visited by this method.
|
|
59
|
+
* And even if the name would be correct it still wouldn't work correctly for
|
|
60
|
+
* react-native projects, because not all targets should get the library added
|
|
61
|
+
* for example: react-native creates *tests and *tvOs and *tvOstests targets.
|
|
62
|
+
*/
|
|
63
|
+
const file = new PbxFile(pathToFramework);
|
|
64
|
+
file.uuid = project.generateUuid();
|
|
65
|
+
file.fileRef = project.generateUuid();
|
|
66
|
+
file.path = pathToFramework;
|
|
67
|
+
file.target = project.getFirstTarget().uuid;
|
|
68
|
+
|
|
69
|
+
if (!project.hasFile(file.path)) {
|
|
70
|
+
project.addToPbxBuildFileSection(file);
|
|
71
|
+
project.addToPbxFileReferenceSection(file);
|
|
72
|
+
// addToFrameworksPbxGroup crashes when it can't find a group named "Frameworks"
|
|
73
|
+
if (!project.pbxGroupByName('Frameworks')) {
|
|
74
|
+
project.addPbxGroup([], 'Frameworks');
|
|
75
|
+
}
|
|
76
|
+
project.addToFrameworksPbxGroup(file);
|
|
77
|
+
project.addToPbxFrameworksBuildPhase(file);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Is this a Cocoapods installation?
|
|
81
|
+
const podFile = path.join(sourceDirectory, 'Podfile');
|
|
82
|
+
const hasPodfile = fs.existsSync(podFile);
|
|
83
|
+
if (!hasPodfile) {
|
|
84
|
+
// Only add FRAMEWORK_SEARCH_PATHS for non-Cocoapod installation
|
|
85
|
+
helpers.addToFrameworkSearchPaths(
|
|
86
|
+
project,
|
|
87
|
+
'$(PROJECT_DIR)/' +
|
|
88
|
+
path.relative(
|
|
89
|
+
projectConfig.sourceDir,
|
|
90
|
+
path.join(moduleDirectory, 'ios')
|
|
91
|
+
),
|
|
92
|
+
true
|
|
93
|
+
);
|
|
94
|
+
} else {
|
|
95
|
+
helpers.addToFrameworkSearchPaths(
|
|
96
|
+
project,
|
|
97
|
+
'$(inherited)',
|
|
98
|
+
false
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
// enable BackgroundModes in xcode project without overriding any previously
|
|
104
|
+
// defined values in the project file.
|
|
105
|
+
// That's why we deep clone all previously defined target attributes and extend
|
|
106
|
+
// them with our target attributes.
|
|
107
|
+
const targetAttributes = helpers.getTargetAttributes(project);
|
|
108
|
+
const systemCapabilities = Object.assign({}, (targetAttributes.SystemCapabilities || {}), {
|
|
109
|
+
'com.apple.BackgroundModes': Object.assign(
|
|
110
|
+
{},
|
|
111
|
+
targetAttributes['com.apple.BackgroundModes'] || {},
|
|
112
|
+
{ enabled: true }
|
|
113
|
+
),
|
|
114
|
+
});
|
|
115
|
+
if (targetAttributes.SystemCapabilities) {
|
|
116
|
+
targetAttributes.SystemCapabilities = systemCapabilities;
|
|
117
|
+
} else {
|
|
118
|
+
project.addTargetAttribute('SystemCapabilities', systemCapabilities);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// add "location" background mode to Info.plist file
|
|
122
|
+
const plist = helpers.readPlist(projectConfig.sourceDir, project);
|
|
123
|
+
const UIBackgroundModes = plist.UIBackgroundModes || [];
|
|
124
|
+
if (UIBackgroundModes.indexOf('location') === -1) {
|
|
125
|
+
plist.UIBackgroundModes = UIBackgroundModes.concat('location');
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Add NSLocationAlwaysUsageDescription
|
|
129
|
+
if (!plist.NSLocationAlwaysUsageDescription) {
|
|
130
|
+
plist.NSLocationAlwaysUsageDescription = "CHANGEME: Location Always Usage Description";
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Add NSLocationAlwaysAndWhenInUseUsageDescription
|
|
134
|
+
if (!plist.NSLocationAlwaysAndWhenInUseUsageDescription) {
|
|
135
|
+
plist.NSLocationAlwaysAndWhenInUseUsageDescription = "CHANGEME: Location Always And When In Use Usage Description";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// Add NSMotionUsageDescription
|
|
139
|
+
if (!plist.NSMotionUsageDescription) {
|
|
140
|
+
plist.NSMotionUsageDescription = "CHANGEME: Motion updates increase battery efficiency by intelligently toggling location-services when device is detected to be moving";
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
helpers.writePlist(projectConfig.sourceDir, project, plist);
|
|
144
|
+
fs.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
|
145
|
+
|
|
146
|
+
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const xcode = require('xcode');
|
|
6
|
+
const PbxFile = require('xcode/lib/pbxFile');
|
|
7
|
+
const helpers = require('./xcode-helpers');
|
|
8
|
+
|
|
9
|
+
const projectDirectory = process.cwd();
|
|
10
|
+
const moduleDirectory = path.resolve(__dirname, '..');
|
|
11
|
+
const sourceDirectory = path.join(projectDirectory, 'ios');
|
|
12
|
+
const xcodeProjectDirectory = helpers.findProject(sourceDirectory);
|
|
13
|
+
|
|
14
|
+
const projectConfig = {
|
|
15
|
+
sourceDir: sourceDirectory,
|
|
16
|
+
pbxprojPath: path.join(
|
|
17
|
+
projectDirectory,
|
|
18
|
+
'ios',
|
|
19
|
+
xcodeProjectDirectory,
|
|
20
|
+
'project.pbxproj'
|
|
21
|
+
),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const pathToFramework = path.relative(
|
|
25
|
+
projectConfig.sourceDir,
|
|
26
|
+
path.join(
|
|
27
|
+
moduleDirectory,
|
|
28
|
+
'ios',
|
|
29
|
+
'RNBackgroundGeolocation',
|
|
30
|
+
'TSLocationManager.framework'
|
|
31
|
+
)
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const project = xcode.project(projectConfig.pbxprojPath).parseSync();
|
|
35
|
+
|
|
36
|
+
const file = new PbxFile(pathToFramework);
|
|
37
|
+
file.target = project.getFirstTarget().uuid;
|
|
38
|
+
|
|
39
|
+
project.removeFromPbxBuildFileSection(file);
|
|
40
|
+
project.removeFromPbxFileReferenceSection(file);
|
|
41
|
+
if (project.pbxGroupByName('Frameworks')) {
|
|
42
|
+
project.removeFromFrameworksPbxGroup(file);
|
|
43
|
+
}
|
|
44
|
+
project.removeFromPbxFrameworksBuildPhase(file);
|
|
45
|
+
|
|
46
|
+
// Is this a Cocoapods installation?
|
|
47
|
+
const podFile = path.join(sourceDirectory, 'Podfile');
|
|
48
|
+
const hasPodfile = fs.existsSync(podFile);
|
|
49
|
+
if (!hasPodfile) {
|
|
50
|
+
helpers.removeFromFrameworkSearchPaths(
|
|
51
|
+
project,
|
|
52
|
+
'$(PROJECT_DIR)/' +
|
|
53
|
+
path.relative(
|
|
54
|
+
projectConfig.sourceDir,
|
|
55
|
+
path.join(moduleDirectory, 'ios')
|
|
56
|
+
)
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// disable BackgroundModes and remove "fetch" mode from plist file
|
|
61
|
+
const systemCapabilities = helpers.getTargetAttributes(project).SystemCapabilities;
|
|
62
|
+
if (systemCapabilities && systemCapabilities['com.apple.BackgroundModes']) {
|
|
63
|
+
delete systemCapabilities['com.apple.BackgroundModes'].enabled;
|
|
64
|
+
if (Object.keys(systemCapabilities['com.apple.BackgroundModes']).length === 0) {
|
|
65
|
+
delete systemCapabilities['com.apple.BackgroundModes'];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (Object.keys(systemCapabilities).length === 0) {
|
|
69
|
+
project.removeTargetAttribute('SystemCapabilities');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const plist = helpers.readPlist(projectConfig.sourceDir, project);
|
|
74
|
+
if (Array.isArray(plist.UIBackgroundModes)) {
|
|
75
|
+
plist.UIBackgroundModes = plist.UIBackgroundModes.filter(
|
|
76
|
+
mode => mode !== 'location'
|
|
77
|
+
);
|
|
78
|
+
if (plist.UIBackgroundModes.length === 0) {
|
|
79
|
+
delete plist.UIBackgroundModes;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
helpers.writePlist(projectConfig.sourceDir, project, plist);
|
|
84
|
+
fs.writeFileSync(projectConfig.pbxprojPath, project.writeSync());
|
|
85
|
+
|
|
86
|
+
////
|
|
87
|
+
// Android
|
|
88
|
+
// - Remove maven url
|
|
89
|
+
// maven {
|
|
90
|
+
// url "$rootDir/../node_modules/react-native-background-geolocation/android/libs"
|
|
91
|
+
// }
|
|
92
|
+
//
|
|
93
|
+
const androidSrcDir = path.join(projectDirectory, 'android');
|
|
94
|
+
const gradleFile = path.join(androidSrcDir, 'build.gradle');
|
|
95
|
+
const moduleName = (process.platform === 'win32') ? moduleDirectory.split('\\').pop() : moduleDirectory.split('/').pop();
|
|
96
|
+
|
|
97
|
+
fs.readFile(gradleFile, 'utf8', function (err,data) {
|
|
98
|
+
if (err) {
|
|
99
|
+
return console.log(err);
|
|
100
|
+
}
|
|
101
|
+
var re = new RegExp("[\\t?\\s?]+maven\\s?\\{[\\n?\\s?\\t?]+url.*" + moduleName + "\\/.*[\\n?\\t?\\s?]+\\}", "gm");
|
|
102
|
+
|
|
103
|
+
if (data.match(re)) {
|
|
104
|
+
fs.writeFile(gradleFile, data.replace(re, ''), 'utf8', function (err) {
|
|
105
|
+
if (err) return console.log(err);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Remove method-call purgeBackgroundGeolocationDebugResources(applicationVariants)
|
|
112
|
+
const appGradleFile = path.join(androidSrcDir, 'app', 'build.gradle');
|
|
113
|
+
const purgeMethodName = "purgeBackgroundGeolocationDebugResources";
|
|
114
|
+
|
|
115
|
+
fs.readFile(appGradleFile, 'utf8', function(err, data) {
|
|
116
|
+
if (err) {
|
|
117
|
+
return console.log(err);
|
|
118
|
+
}
|
|
119
|
+
var purgeMethodRE = new RegExp("^[\\s\\t]+" + purgeMethodName + "\\(applicationVariants\\).*$[\\s\\n]+(.*)", "gm");
|
|
120
|
+
|
|
121
|
+
if (purgeMethodRE.test(data)) {
|
|
122
|
+
data = data.replace(purgeMethodRE, '\t$1');
|
|
123
|
+
}
|
|
124
|
+
fs.writeFile(appGradleFile, data, 'utf8', function (err) {
|
|
125
|
+
if (err) return console.log(err);
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"baseUrl": "",
|
|
4
|
+
"allowSyntheticDefaultImports": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true,
|
|
8
|
+
"lib": [
|
|
9
|
+
"dom",
|
|
10
|
+
"es2015"
|
|
11
|
+
],
|
|
12
|
+
"module": "es2015",
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"target": "es5"
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"../src/declarations/*.d.ts",
|
|
19
|
+
"../src/declarations/interfaces/*d.ts"
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const glob = require('glob');
|
|
4
|
+
// unfortunately we can't use the 'plist' module at the moment for parsing
|
|
5
|
+
// because it has a few issues with empty strings and keys.
|
|
6
|
+
// There are several issues and PRs on that repository open though and hopefully
|
|
7
|
+
// we can revert back to only using one module once they're merged.
|
|
8
|
+
const plistParser = require('fast-plist');
|
|
9
|
+
const plistWriter = require('plist');
|
|
10
|
+
|
|
11
|
+
// The getBuildProperty method of the 'xcode' project is a bit naive in that it
|
|
12
|
+
// doesn't take a specific target but iterates over all of them and doesn't have
|
|
13
|
+
// an exit condition if a property has been found.
|
|
14
|
+
// Which in the case of react-native projects usually is the tvOS target because
|
|
15
|
+
// it comes last.
|
|
16
|
+
function getBuildProperty(project, property) {
|
|
17
|
+
const firstTarget = project.getFirstTarget().firstTarget;
|
|
18
|
+
const configurationList = project.pbxXCConfigurationList()[
|
|
19
|
+
firstTarget.buildConfigurationList
|
|
20
|
+
];
|
|
21
|
+
const defaultBuildConfiguration = configurationList.buildConfigurations.reduce(
|
|
22
|
+
(acc, config) => {
|
|
23
|
+
const buildSection = project.pbxXCBuildConfigurationSection()[
|
|
24
|
+
config.value
|
|
25
|
+
];
|
|
26
|
+
return buildSection.name ===
|
|
27
|
+
configurationList.defaultConfigurationName
|
|
28
|
+
? buildSection
|
|
29
|
+
: acc;
|
|
30
|
+
},
|
|
31
|
+
configurationList.buildConfigurations[0]
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return defaultBuildConfiguration.buildSettings[property];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getPlistPath(sourceDir, project) {
|
|
38
|
+
const plistFile = getBuildProperty(project, 'INFOPLIST_FILE');
|
|
39
|
+
if (!plistFile) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
return path.join(
|
|
43
|
+
sourceDir,
|
|
44
|
+
plistFile.replace(/"/g, '').replace('$(SRCROOT)', '')
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function readPlist(sourceDir, project) {
|
|
49
|
+
const plistPath = getPlistPath(sourceDir, project);
|
|
50
|
+
if (!plistPath || !fs.existsSync(plistPath)) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return plistParser.parse(fs.readFileSync(plistPath, 'utf-8'));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function writePlist(sourceDir, project, plist) {
|
|
57
|
+
fs.writeFileSync(
|
|
58
|
+
getPlistPath(sourceDir, project),
|
|
59
|
+
plistWriter.build(plist)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// based on: https://github.com/facebook/react-native/blob/545072b/local-cli/link/ios/mapHeaderSearchPaths.js#L5
|
|
64
|
+
function eachBuildConfiguration(project, predicate, callback) {
|
|
65
|
+
const config = project.pbxXCBuildConfigurationSection();
|
|
66
|
+
Object.keys(config)
|
|
67
|
+
.filter(ref => ref.indexOf('_comment') === -1)
|
|
68
|
+
.filter(ref => predicate(config[ref]))
|
|
69
|
+
.forEach(ref => callback(config[ref]));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// this is being used to determine whether the current target is a react-native
|
|
73
|
+
// project: https://github.com/facebook/react-native/blob/545072b/local-cli/link/ios/mapHeaderSearchPaths.js#L31
|
|
74
|
+
function hasLCPlusPlus(config) {
|
|
75
|
+
return (config.buildSettings.OTHER_LDFLAGS || []).indexOf('"-lc++"') >= 0;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// based on: https://github.com/facebook/react-native/blob/1490ab1/local-cli/core/ios/findProject.js
|
|
79
|
+
function findProject(folder) {
|
|
80
|
+
const GLOB_PATTERN = '**/*.xcodeproj';
|
|
81
|
+
const TEST_PROJECTS = /test|example|sample/i;
|
|
82
|
+
const IOS_BASE = 'ios';
|
|
83
|
+
const GLOB_EXCLUDE_PATTERN = ['**/@(Pods|node_modules)/**'];
|
|
84
|
+
|
|
85
|
+
const projects = glob
|
|
86
|
+
.sync(GLOB_PATTERN, {
|
|
87
|
+
cwd: folder,
|
|
88
|
+
ignore: GLOB_EXCLUDE_PATTERN,
|
|
89
|
+
})
|
|
90
|
+
.filter(project => {
|
|
91
|
+
return path.dirname(project) === IOS_BASE || !TEST_PROJECTS.test(project);
|
|
92
|
+
})
|
|
93
|
+
.sort((projectA, projectB) => {
|
|
94
|
+
return path.dirname(projectA) === IOS_BASE ? -1 : 1;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (projects.length === 0) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return projects[0];
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
function addToFrameworkSearchPaths(project, path, recursive) {
|
|
105
|
+
eachBuildConfiguration(project, hasLCPlusPlus, config => {
|
|
106
|
+
if (!config.buildSettings.FRAMEWORK_SEARCH_PATHS) {
|
|
107
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = [];
|
|
108
|
+
} else if (typeof config.buildSettings.FRAMEWORK_SEARCH_PATHS === 'string') {
|
|
109
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = [config.buildSettings.FRAMEWORK_SEARCH_PATHS];
|
|
110
|
+
}
|
|
111
|
+
const fullPath = '"' + path + (recursive ? '/**' : '') + '"';
|
|
112
|
+
|
|
113
|
+
if (
|
|
114
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS.indexOf(fullPath) === -1
|
|
115
|
+
) {
|
|
116
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = config.buildSettings.FRAMEWORK_SEARCH_PATHS.concat(
|
|
117
|
+
fullPath
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function removeFromFrameworkSearchPaths(project, path) {
|
|
124
|
+
eachBuildConfiguration(project, hasLCPlusPlus, config => {
|
|
125
|
+
if (!config.buildSettings.FRAMEWORK_SEARCH_PATHS) {
|
|
126
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = [];
|
|
127
|
+
} else if (typeof config.buildSettings.FRAMEWORK_SEARCH_PATHS === 'string') {
|
|
128
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = [config.buildSettings.FRAMEWORK_SEARCH_PATHS];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const fullPath = unquote(path) + '/**';
|
|
132
|
+
|
|
133
|
+
config.buildSettings.FRAMEWORK_SEARCH_PATHS = config.buildSettings.FRAMEWORK_SEARCH_PATHS.filter(
|
|
134
|
+
searchPath =>
|
|
135
|
+
unquote(searchPath) !== unquote(path) &&
|
|
136
|
+
unquote(searchPath) !== fullPath
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// The node-xcode library doesn't offer a method to get all target attributes,
|
|
142
|
+
// so we'll have to implement it ourselves.
|
|
143
|
+
function getTargetAttributes(project, target) {
|
|
144
|
+
var attributes = project.getFirstProject()['firstProject']['attributes'];
|
|
145
|
+
target = target || project.getFirstTarget();
|
|
146
|
+
|
|
147
|
+
if (attributes['TargetAttributes'] === undefined) {
|
|
148
|
+
attributes['TargetAttributes'] = {};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (attributes['TargetAttributes'][target.uuid] === undefined) {
|
|
152
|
+
attributes['TargetAttributes'][target.uuid] = {};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return attributes['TargetAttributes'][target.uuid];
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function unquote(str) {
|
|
159
|
+
return (str || '').replace(/^"(.*)"$/, '$1');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
module.exports = {
|
|
163
|
+
getBuildProperty: getBuildProperty,
|
|
164
|
+
getPlistPath: getPlistPath,
|
|
165
|
+
readPlist: readPlist,
|
|
166
|
+
writePlist: writePlist,
|
|
167
|
+
getTargetAttributes: getTargetAttributes,
|
|
168
|
+
addToFrameworkSearchPaths: addToFrameworkSearchPaths,
|
|
169
|
+
removeFromFrameworkSearchPaths: removeFromFrameworkSearchPaths,
|
|
170
|
+
findProject: findProject,
|
|
171
|
+
};
|