├── .github ├── ISSUE_TEMPLATE │ ├── 1-bug.yml │ └── 2-help-wanted.yml └── workflows │ └── stale.yaml ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── ISSUE_TEMPLATE.md ├── LICENSE ├── README.md ├── RNBackgroundGeolocation.podspec ├── android ├── .gitignore ├── RNBackgroundGeolocation.iml ├── android.iml ├── app.gradle ├── build.gradle ├── libs │ └── com │ │ └── transistorsoft │ │ ├── tslocationmanager-v21 │ │ ├── 3.6.7 │ │ │ ├── tslocationmanager-v21-3.6.7.aar │ │ │ ├── tslocationmanager-v21-3.6.7.aar.md5 │ │ │ ├── tslocationmanager-v21-3.6.7.aar.sha1 │ │ │ ├── tslocationmanager-v21-3.6.7.aar.sha256 │ │ │ ├── tslocationmanager-v21-3.6.7.aar.sha512 │ │ │ ├── tslocationmanager-v21-3.6.7.pom │ │ │ ├── tslocationmanager-v21-3.6.7.pom.md5 │ │ │ ├── tslocationmanager-v21-3.6.7.pom.sha1 │ │ │ ├── tslocationmanager-v21-3.6.7.pom.sha256 │ │ │ └── tslocationmanager-v21-3.6.7.pom.sha512 │ │ └── maven-metadata.xml │ │ └── tslocationmanager │ │ ├── 3.6.7 │ │ ├── tslocationmanager-3.6.7.aar │ │ ├── tslocationmanager-3.6.7.aar.md5 │ │ ├── tslocationmanager-3.6.7.aar.sha1 │ │ ├── tslocationmanager-3.6.7.aar.sha256 │ │ ├── tslocationmanager-3.6.7.aar.sha512 │ │ ├── tslocationmanager-3.6.7.pom │ │ ├── tslocationmanager-3.6.7.pom.md5 │ │ ├── tslocationmanager-3.6.7.pom.sha1 │ │ ├── tslocationmanager-3.6.7.pom.sha256 │ │ └── tslocationmanager-3.6.7.pom.sha512 │ │ └── maven-metadata.xml ├── proguard-rules.pro ├── react-native-background-geolocation-android.iml └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── transistorsoft │ │ └── rnbackgroundgeolocation │ │ ├── HeadlessTask.java │ │ ├── HeadlessTaskManager.java │ │ ├── RNBackgroundGeolocation.java │ │ └── RNBackgroundGeolocationModule.java │ └── res │ └── values │ └── strings.xml ├── app.plugin.js ├── bin ├── actions.js ├── cli └── lib.js ├── docs ├── .nojekyll ├── assets │ ├── css │ │ └── main.css │ ├── images │ │ ├── favicon.ico │ │ ├── icons.png │ │ ├── icons.psd │ │ ├── icons@2x.png │ │ ├── logo-black-150.png │ │ ├── transistor-logo-bw.svg │ │ ├── transistor-logo.svg │ │ ├── widgets-foo.png │ │ ├── widgets.png │ │ ├── widgets.psd │ │ └── widgets@2x.png │ └── js │ │ ├── main.js │ │ └── search.js ├── classes │ └── backgroundgeolocation.html ├── index.html └── interfaces │ ├── authorization.html │ ├── authorizationevent.html │ ├── battery.html │ ├── config.html │ ├── connectivitychangeevent.html │ ├── coords.html │ ├── currentpositionrequest.html │ ├── deviceinfo.html │ ├── devicesettings.html │ ├── devicesettingsrequest.html │ ├── geofence.html │ ├── geofenceevent.html │ ├── geofenceschangeevent.html │ ├── headlessevent.html │ ├── heartbeatevent.html │ ├── httpevent.html │ ├── location.html │ ├── locationauthorizationalert.html │ ├── logger.html │ ├── motionactivity.html │ ├── motionactivityevent.html │ ├── motionchangeevent.html │ ├── notification.html │ ├── permissionrationale.html │ ├── providerchangeevent.html │ ├── sensors.html │ ├── sqlquery.html │ ├── state.html │ ├── subscription.html │ ├── transistorauthorizationtoken.html │ └── watchpositionrequest.html ├── expo └── plugin │ ├── src │ ├── androidPlugin.ts │ ├── iOSPlugin.ts │ └── index.ts │ └── tsconfig.json ├── help ├── INSTALL-ANDROID-AUTO.md ├── INSTALL-ANDROID-RNPM.md ├── INSTALL-ANDROID.md ├── INSTALL-EXPO.md ├── INSTALL-IOS-AUTO.md ├── INSTALL-IOS-COCOAPODS.md ├── INSTALL-IOS-RNPM.md ├── INSTALL-IOS.md ├── PRIVACY_POLICY.md ├── README.md ├── geofencing.md ├── http.md └── timing-diagram.md ├── ios ├── RNBackgroundGeolocation.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── RNBackgroundGeolocation │ ├── RNBackgroundGeolocation.h │ ├── RNBackgroundGeolocation.m │ └── TSLocationManager.xcframework │ │ ├── Info.plist │ │ ├── _CodeSignature │ │ ├── CodeDirectory │ │ ├── CodeRequirements │ │ ├── CodeRequirements-1 │ │ ├── CodeResources │ │ └── CodeSignature │ │ ├── ios-arm64 │ │ └── TSLocationManager.framework │ │ │ ├── Headers │ │ │ ├── AtomicBoolean.h │ │ │ ├── ConfigModule.h │ │ │ ├── HttpRequest.h │ │ │ ├── HttpResponse.h │ │ │ ├── LocationManager.h │ │ │ ├── LogQuery.h │ │ │ ├── SOMotionDetector.h │ │ │ ├── SQLQuery.h │ │ │ ├── TSActivityChangeEvent.h │ │ │ ├── TSAuthorization.h │ │ │ ├── TSAuthorizationEvent.h │ │ │ ├── TSCallback.h │ │ │ ├── TSConfig.h │ │ │ ├── TSConnectivityChangeEvent.h │ │ │ ├── TSCurrentPositionRequest.h │ │ │ ├── TSDeviceInfo.h │ │ │ ├── TSEnabledChangeEvent.h │ │ │ ├── TSGeofence.h │ │ │ ├── TSGeofenceEvent.h │ │ │ ├── TSGeofenceManager.h │ │ │ ├── TSGeofencesChangeEvent.h │ │ │ ├── TSHeartbeatEvent.h │ │ │ ├── TSHttpEvent.h │ │ │ ├── TSHttpService.h │ │ │ ├── TSLocation.h │ │ │ ├── TSLocationManager.h │ │ │ ├── TSPowerSaveChangeEvent.h │ │ │ ├── TSProviderChangeEvent.h │ │ │ ├── TSReachability.h │ │ │ ├── TSSchedule.h │ │ │ ├── TSScheduleEvent.h │ │ │ ├── TSWatchPositionRequest.h │ │ │ └── TransistorAuthorizationToken.h │ │ │ ├── Info.plist │ │ │ ├── Miniball │ │ │ └── Miniball.hpp │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── PrivacyInfo.xcprivacy │ │ │ ├── TSLocationManager │ │ │ └── _CodeSignature │ │ │ ├── CodeDirectory │ │ │ ├── CodeRequirements │ │ │ ├── CodeRequirements-1 │ │ │ ├── CodeResources │ │ │ └── CodeSignature │ │ ├── ios-arm64_x86_64-maccatalyst │ │ └── TSLocationManager.framework │ │ │ ├── Headers │ │ │ ├── AtomicBoolean.h │ │ │ ├── ConfigModule.h │ │ │ ├── HttpRequest.h │ │ │ ├── HttpResponse.h │ │ │ ├── LocationManager.h │ │ │ ├── LogQuery.h │ │ │ ├── SOMotionDetector.h │ │ │ ├── SQLQuery.h │ │ │ ├── TSActivityChangeEvent.h │ │ │ ├── TSAuthorization.h │ │ │ ├── TSAuthorizationEvent.h │ │ │ ├── TSCallback.h │ │ │ ├── TSConfig.h │ │ │ ├── TSConnectivityChangeEvent.h │ │ │ ├── TSCurrentPositionRequest.h │ │ │ ├── TSDeviceInfo.h │ │ │ ├── TSEnabledChangeEvent.h │ │ │ ├── TSGeofence.h │ │ │ ├── TSGeofenceEvent.h │ │ │ ├── TSGeofenceManager.h │ │ │ ├── TSGeofencesChangeEvent.h │ │ │ ├── TSHeartbeatEvent.h │ │ │ ├── TSHttpEvent.h │ │ │ ├── TSHttpService.h │ │ │ ├── TSLocation.h │ │ │ ├── TSLocationManager.h │ │ │ ├── TSPowerSaveChangeEvent.h │ │ │ ├── TSProviderChangeEvent.h │ │ │ ├── TSReachability.h │ │ │ ├── TSSchedule.h │ │ │ ├── TSScheduleEvent.h │ │ │ ├── TSWatchPositionRequest.h │ │ │ └── TransistorAuthorizationToken.h │ │ │ ├── Modules │ │ │ └── module.modulemap │ │ │ ├── Resources │ │ │ ├── Info.plist │ │ │ ├── Miniball │ │ │ │ └── Miniball.hpp │ │ │ └── PrivacyInfo.xcprivacy │ │ │ ├── TSLocationManager │ │ │ └── _CodeSignature │ │ │ ├── CodeDirectory │ │ │ ├── CodeRequirements │ │ │ ├── CodeRequirements-1 │ │ │ ├── CodeResources │ │ │ └── CodeSignature │ │ └── ios-arm64_x86_64-simulator │ │ └── TSLocationManager.framework │ │ ├── Headers │ │ ├── AtomicBoolean.h │ │ ├── ConfigModule.h │ │ ├── HttpRequest.h │ │ ├── HttpResponse.h │ │ ├── LocationManager.h │ │ ├── LogQuery.h │ │ ├── SOMotionDetector.h │ │ ├── SQLQuery.h │ │ ├── TSActivityChangeEvent.h │ │ ├── TSAuthorization.h │ │ ├── TSAuthorizationEvent.h │ │ ├── TSCallback.h │ │ ├── TSConfig.h │ │ ├── TSConnectivityChangeEvent.h │ │ ├── TSCurrentPositionRequest.h │ │ ├── TSDeviceInfo.h │ │ ├── TSEnabledChangeEvent.h │ │ ├── TSGeofence.h │ │ ├── TSGeofenceEvent.h │ │ ├── TSGeofenceManager.h │ │ ├── TSGeofencesChangeEvent.h │ │ ├── TSHeartbeatEvent.h │ │ ├── TSHttpEvent.h │ │ ├── TSHttpService.h │ │ ├── TSLocation.h │ │ ├── TSLocationManager.h │ │ ├── TSPowerSaveChangeEvent.h │ │ ├── TSProviderChangeEvent.h │ │ ├── TSReachability.h │ │ ├── TSSchedule.h │ │ ├── TSScheduleEvent.h │ │ ├── TSWatchPositionRequest.h │ │ └── TransistorAuthorizationToken.h │ │ ├── Info.plist │ │ ├── Miniball │ │ └── Miniball.hpp │ │ ├── Modules │ │ └── module.modulemap │ │ ├── PrivacyInfo.xcprivacy │ │ ├── TSLocationManager │ │ └── _CodeSignature │ │ ├── CodeDirectory │ │ ├── CodeRequirements │ │ ├── CodeRequirements-1 │ │ ├── CodeResources │ │ └── CodeSignature ├── RNBackgroundGeolocationTests │ └── Info.plist └── Resources │ └── PrivacyInfo.xcprivacy ├── package.json ├── scripts ├── cp-declarations ├── declare-module ├── docs-index.html ├── generate-docs ├── tsconfig.json └── xcode-helpers.js └── src ├── DeviceSettings.js ├── Events.js ├── Logger.js ├── NativeModule.js ├── TransistorAuthorizationToken.js ├── declarations ├── BackgroundGeolocation.d.ts ├── interfaces │ ├── Authorization.d.ts │ ├── AuthorizationEvent.d.ts │ ├── Config.d.ts │ ├── ConnectivityChangeEvent.d.ts │ ├── CurrentPositionRequest.d.ts │ ├── DeviceInfo.d.ts │ ├── DeviceSettings.d.ts │ ├── Geofence.d.ts │ ├── GeofenceEvent.d.ts │ ├── GeofencesChangeEvent.d.ts │ ├── HeadlessEvent.d.ts │ ├── HeartbeatEvent.d.ts │ ├── HttpEvent.d.ts │ ├── Location.d.ts │ ├── LocationAuthorizationAlert.d.ts │ ├── Logger.d.ts │ ├── MotionActivityEvent.d.ts │ ├── MotionChangeEvent.d.ts │ ├── Notification.d.ts │ ├── PermissionRationale.d.ts │ ├── ProviderChangeEvent.d.ts │ ├── SQLQuery.d.ts │ ├── Sensors.d.ts │ ├── State.d.ts │ ├── Subscription.d.ts │ ├── TransistorAuthorizationToken.d.ts │ └── WatchPositionRequest.d.ts └── types.d.ts ├── index.d.ts └── index.js /.github/ISSUE_TEMPLATE/1-bug.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report. 3 | title: "[Bug]: " 4 | labels: ["bug", "triage"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this support request. 10 | - type: checkboxes 11 | id: terms 12 | attributes: 13 | label: Required Reading 14 | description: "- I have read the Wikis [Philosophy of Operation](../wiki/Philosophy-of-Operation) and [Debugging](../wiki/Debugging)\n- I am aware of the [API Documentation](https://transistorsoft.github.io/react-native-background-geolocation/)\n- I am aware of the [CHANGELOG](../blob/master/CHANGELOG.md)" 15 | options: 16 | - label: Confirmed 17 | required: true 18 | - type: input 19 | id: version 20 | attributes: 21 | label: Plugin Version 22 | description: What version of our software are you running? 23 | placeholder: "Consult your package.json (do not enter 'latest')" 24 | validations: 25 | required: true 26 | - type: checkboxes 27 | id: os 28 | attributes: 29 | label: Mobile operating-system(s) 30 | description: Which mobile operating-system(s) is this issue reported upon? 31 | options: 32 | - label: iOS 33 | - label: Android 34 | - type: input 35 | id: device-info 36 | attributes: 37 | label: Device Manufacturer(s) and Model(s) 38 | description: What is the device model(s) and manufacturer(s) 39 | placeholder: eg Google Pixel 6, iPhone 13 Pro 40 | validations: 41 | required: true 42 | - type: input 43 | id: device-os 44 | attributes: 45 | label: Device operating-systems(s) 46 | description: Affected device operating system 47 | placeholder: eg iOS 18.1, Android 13 48 | validations: 49 | required: true 50 | - type: input 51 | id: framework-version 52 | attributes: 53 | label: React Native / Expo version 54 | description: What version React Native / Expo are you using 55 | placeholder: "eg: 0.76.6, Expo 52 (consult your package.json)" 56 | - type: textarea 57 | id: what-happened 58 | attributes: 59 | label: What happened? 60 | description: Also tell us, what did you expect to happen? 61 | placeholder: Tell us what happened and what did you expect to happen. 62 | validations: 63 | required: true 64 | - type: textarea 65 | id: config 66 | attributes: 67 | label: Plugin Code and/or Config 68 | description: Provide the Config you're using with the `BackgroundGeolocation.ready(config)` method along with any other relevant code. 69 | placeholder: "Paste your Config or code here, eg: BackgroundGeolocation.ready(config).\n\nYour code will be automatically syntax-highlighted" 70 | render: typescript 71 | validations: 72 | required: true 73 | - type: textarea 74 | id: logs 75 | attributes: 76 | label: Relevant log output 77 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 78 | placeholder: "include iOS / Android logs\n- $ adb logcat -s TSLocationManager:V\n- ios XCode logs\n- Logs from BackgroundGeolocation.emailLog(address)" 79 | render: shell 80 | 81 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-help-wanted.yml: -------------------------------------------------------------------------------- 1 | name: Help Wanted 2 | description: I need assistance 3 | title: "[Help Wanted]: " 4 | labels: ["triage"] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out this support request. 10 | - type: checkboxes 11 | id: terms 12 | attributes: 13 | label: Required Reading 14 | description: "- I have read the Wikis [Philosophy of Operation](../wiki/Philosophy-of-Operation) and [Debugging](../wiki/Debugging)\n- I am aware of the [API Documentation](https://transistorsoft.github.io/react-native-background-geolocation/)\n- I am aware of the [CHANGELOG](../blob/master/CHANGELOG.md)" 15 | options: 16 | - label: Confirmed 17 | required: true 18 | - type: input 19 | id: version 20 | attributes: 21 | label: Plugin Version 22 | description: What version of our software are you running? 23 | placeholder: "Consult your package.json (do not enter 'latest')" 24 | validations: 25 | required: true 26 | - type: checkboxes 27 | id: os 28 | attributes: 29 | label: Mobile operating-system(s) 30 | description: Which mobile operating-system(s) is this about? 31 | options: 32 | - label: iOS 33 | - label: Android 34 | validations: 35 | required: true 36 | - type: input 37 | id: device-info 38 | attributes: 39 | label: Device Manufacturer(s) and Model(s) 40 | description: What is the device model(s) and manufacturer(s) 41 | placeholder: eg Google Pixel 6, iPhone 13 Pro 42 | validations: 43 | required: true 44 | - type: input 45 | id: device-os 46 | attributes: 47 | label: Device operating-systems(s) 48 | description: Affected device operating system 49 | placeholder: eg iOS 18.1, Android 13 50 | validations: 51 | required: true 52 | - type: input 53 | id: framework-version 54 | attributes: 55 | label: React Native / Expo version 56 | description: What version React Native / Expo are you using 57 | placeholder: "eg: 0.76.6, Expo 52 (consult your package.json)" 58 | - type: textarea 59 | id: what-happened 60 | attributes: 61 | label: What do you require assistance about? 62 | validations: 63 | required: true 64 | - type: textarea 65 | id: config 66 | attributes: 67 | label: "[Optional] Plugin Code and/or Config" 68 | description: Provide the Config you're using with the `BackgroundGeolocation.ready(config)` method along with any other relevant code. 69 | placeholder: "Paste your Config or code here, eg: BackgroundGeolocation.ready(config).\n\nYour code will be automatically syntax-highlighted" 70 | render: typescript 71 | validations: 72 | required: false 73 | - type: textarea 74 | id: logs 75 | attributes: 76 | label: "[Optional] Relevant log output" 77 | description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. 78 | placeholder: "include iOS / Android logs\n- $ adb logcat -s TSLocationManager:V\n- ios XCode logs\n- Logs from BackgroundGeolocation.emailLog(address)" 79 | render: shell 80 | validations: 81 | required: false 82 | 83 | -------------------------------------------------------------------------------- /.github/workflows/stale.yaml: -------------------------------------------------------------------------------- 1 | name: Close inactive issues 2 | on: 3 | schedule: 4 | - cron: "30 1 * * *" 5 | 6 | jobs: 7 | close-issues: 8 | runs-on: ubuntu-latest 9 | permissions: 10 | issues: write 11 | pull-requests: write 12 | steps: 13 | - uses: actions/stale@v5 14 | with: 15 | operations-per-run: 100 16 | days-before-issue-stale: 30 17 | days-before-issue-close: 14 18 | stale-issue-label: "stale" 19 | stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." 20 | close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." 21 | days-before-pr-stale: -1 22 | days-before-pr-close: -1 23 | repo-token: ${{ secrets.GITHUB_TOKEN }} 24 | 25 | 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/**/* 3 | 4 | # Xcode 5 | # 6 | build/ 7 | *.pbxuser 8 | !default.pbxuser 9 | *.mode1v3 10 | !default.mode1v3 11 | *.mode2v3 12 | !default.mode2v3 13 | *.perspectivev3 14 | !default.perspectivev3 15 | xcuserdata 16 | *.xccheckout 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | *.xcuserstate 22 | 23 | # CocoaPods 24 | # 25 | # We recommend against adding the Pods directory to your .gitignore. However 26 | # you should judge for yourself, the pros and cons are mentioned at: 27 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 28 | # 29 | #Pods/ 30 | npm-debug.log 31 | 32 | android/.idea 33 | 34 | package-lock.json 35 | 36 | *.tgz 37 | 38 | yarn.lock 39 | 40 | # Expo build 41 | expo/plugin/build/** 42 | 43 | *.log 44 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | docs 3 | help 4 | bin 5 | README.md 6 | ISSUE_TEMPLATE.md 7 | *.md 8 | node_modules 9 | *.tgz 10 | 11 | scripts 12 | 13 | # Expo 14 | expo/plugin/src 15 | expo/plugin/tsconfig.json 16 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 6 | 7 | 10 | ## Your Environment 11 | * Plugin version: 12 | * Platform: iOS or Android 13 | * OS version: 14 | * Device manufacturer / model: 15 | * React Native version (`react-native -v`): 16 | * Plugin config 17 | ```javascript 18 | PASTE_YOUR_CODE_HERE 19 | ``` 20 | 21 | ## Expected Behavior 22 | 23 | 24 | ## Actual Behavior 25 | 26 | 27 | ## Steps to Reproduce 28 | 29 | 1. 30 | 2. 31 | 3. 32 | 4. 33 | 34 | ## Context 35 | 36 | 37 | ## Debug logs 38 | 43 |
Logs 44 | 45 | ``` 46 | PASTE_YOUR_LOGS_HERE 47 | ``` 48 | 49 |
50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Chris Scott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /RNBackgroundGeolocation.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.cocoapods_version = '>= 1.10.0' 7 | s.name = 'RNBackgroundGeolocation' 8 | s.version = package['version'] 9 | s.summary = package['description'] 10 | s.description = <<-DESC 11 | Cross-platform background geolocation module for React Native with 12 | battery-saving circular stationary-region monitoring and stop detection. 13 | DESC 14 | s.homepage = package['homepage'] 15 | s.license = package['license'] 16 | s.author = package['author'] 17 | s.source = { :git => 'https://github.com/transistorsoft/react-native-background-geolocation.git', :tag => s.version } 18 | s.platform = :ios, '9.0' 19 | 20 | s.dependency 'React-Core' 21 | s.static_framework = true 22 | s.preserve_paths = 'docs', 'CHANGELOG.md', 'LICENSE', 'package.json', 'RNBackgroundGeolocation.ios.js' 23 | s.dependency 'CocoaLumberjack', '~> 3.8.5' 24 | s.source_files = 'ios/RNBackgroundGeolocation/*.{h,m}' 25 | s.libraries = 'sqlite3', 'z', 'stdc++' 26 | s.vendored_frameworks = 'ios/RNBackgroundGeolocation/TSLocationManager.xcframework' 27 | s.resource_bundles = {'TSLocationManagerPrivacy' => ['ios/Resources/PrivacyInfo.xcprivacy']} 28 | end 29 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /android/android.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /android/app.gradle: -------------------------------------------------------------------------------- 1 | 2 | android { 3 | purgeBackgroundGeolocationDebugResources(applicationVariants) 4 | } 5 | 6 | /** 7 | * Background Geolocation's aar includes about 1.5M of mp3 sound-files for its debugging sound FX. 8 | * This method strips those mp3s out in RELEASE builds. 9 | */ 10 | def purgeBackgroundGeolocationDebugResources(applicationVariants) { 11 | if ((rootProject.ext.has("removeBackgroundGeolocationDebugSoundsInRelease")) && (rootProject.ext.removeBackgroundGeolocationDebugSoundsInRelease == false)) return 12 | applicationVariants.all { variant -> 13 | if (variant.buildType.name == "release") { 14 | println("[react-native-background-geolocation] Purging debug resources in release build") 15 | variant.mergeResourcesProvider.configure { 16 | doLast { 17 | delete(fileTree(dir: outputDir, includes: ["raw_tslocationmanager*"])) 18 | } 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar.md5: -------------------------------------------------------------------------------- 1 | d422b9cdb3cfd3968aeea801e1d066f0 -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar.sha1: -------------------------------------------------------------------------------- 1 | e3c35cdbce5efcdc03127cbe13ba895d6dde582b -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar.sha256: -------------------------------------------------------------------------------- 1 | cda03397a8e7efb69d2b530596d27d9c290fcd47a577ec4238620f0bb257dec8 -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.aar.sha512: -------------------------------------------------------------------------------- 1 | 7c236930f08450ed0841c9e9dfe198401891098fc3cbb8e98cbf49dbab09711707f74863696ba0e047f3bf4e0625768ef471926558ae0d8f307ae7c357f46e74 -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.transistorsoft 6 | tslocationmanager-v21 7 | 3.6.7 8 | aar 9 | 10 | -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.pom.md5: -------------------------------------------------------------------------------- 1 | 05c6491cf05ad0671f915a9e9328420c -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.pom.sha1: -------------------------------------------------------------------------------- 1 | d2385c3c915a21cfcc0c009262efee3eafb9b41c -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.pom.sha256: -------------------------------------------------------------------------------- 1 | 9041e4a0ec12d030768a37f0f786170d702c9879bde7ef62ff820fa7eff6fe5a -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/3.6.7/tslocationmanager-v21-3.6.7.pom.sha512: -------------------------------------------------------------------------------- 1 | 6190dd1a1c6a45d492ea8a3f805835a994565d0a616de7d91d27ddf77a67fa0ce5879d62630af150a7b4d212e7ed2055178efe3bbc941f9d354477ddafff883c -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager-v21/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.transistorsoft 4 | tslocationmanager-v21 5 | 6 | 3.6.7 7 | 3.6.7 8 | 9 | 3.6.6 10 | 3.6.7 11 | 12 | 20250516153412 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar.md5: -------------------------------------------------------------------------------- 1 | f63d3559ada7de34670497fd8d9fda4d -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar.sha1: -------------------------------------------------------------------------------- 1 | cb3978b8b4851bccde70550de56e30350a01656c -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar.sha256: -------------------------------------------------------------------------------- 1 | f8771a4d3455d40b7722a75468d4c0882e1f35810ce3098aa1d1d6418e4de2e7 -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.aar.sha512: -------------------------------------------------------------------------------- 1 | 999caf3cce3b56f0297322f623f99cec54f082484feaaddd785f13166a2ce01569d8cf6e2fa68108363907e532d405b46c5c8ffa34ed41528e6cf4e59a664ceb -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.pom: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | com.transistorsoft 6 | tslocationmanager 7 | 3.6.7 8 | aar 9 | 10 | -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.pom.md5: -------------------------------------------------------------------------------- 1 | 74550cca266066d048113f0b9650fd5c -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.pom.sha1: -------------------------------------------------------------------------------- 1 | 54d509f4ded6c70430a3ec085f19058d4afd292b -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.pom.sha256: -------------------------------------------------------------------------------- 1 | 41fa79635bb816d02e1bee1f592d0fd337e1b0923e17dffb3baf11dc57e9cf8b -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/3.6.7/tslocationmanager-3.6.7.pom.sha512: -------------------------------------------------------------------------------- 1 | 6033cc822dbf6f288b260770a18ba7c8535140a35d68823843c22c45566526fa4b1f30524a51b59273d325136d83b50906fea8ca517b8f7bdd095d718ca2f62a -------------------------------------------------------------------------------- /android/libs/com/transistorsoft/tslocationmanager/maven-metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.transistorsoft 4 | tslocationmanager 5 | 6 | 3.6.7 7 | 3.6.7 8 | 9 | 3.6.6 10 | 3.6.7 11 | 12 | 20250516153412 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | -keepnames class com.facebook.react.ReactActivity 2 | 3 | # for react-native Headless on new architecture 4 | -keep class com.facebook.react.defaults.DefaultNewArchitectureEntryPoint { 5 | public ; 6 | } 7 | -keep class com.facebook.react.ReactApplication { 8 | public ; 9 | } 10 | -keep class com.facebook.react.ReactHost { 11 | public ; 12 | } 13 | -keep class * extends com.facebook.react.ReactHost { 14 | public ; 15 | } 16 | -keep class com.facebook.react.fabric.** { *; } 17 | 18 | -keepnames class com.transistorsoft.rnbackgroundgeolocation.RNBackgroundGeolocation 19 | 20 | -keep class com.transistorsoft** { *; } 21 | -dontwarn com.transistorsoft.** 22 | 23 | # Huawei HMS Adapter 24 | -dontwarn com.transistorsoft.xms.** 25 | -dontwarn com.huawei.** 26 | 27 | -keep class com.google.android.gms.** {*;} 28 | -keep interface com.google.android.gms.** {*;} 29 | 30 | # BackgroundGeolocation (EventBus) 31 | -keepattributes *Annotation* 32 | -keepclassmembers class * { 33 | @org.greenrobot.eventbus.Subscribe ; 34 | } 35 | -keep enum org.greenrobot.eventbus.ThreadMode { *; } 36 | 37 | # And if you use AsyncExecutor: 38 | -keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent { 39 | (java.lang.Throwable); 40 | } 41 | 42 | # logback 43 | -keep class ch.qos** { *; } 44 | -keep class org.slf4j** { *; } 45 | -dontwarn ch.qos.logback.core.net.* 46 | 47 | # OkHttp3 48 | -dontwarn okio.** 49 | -dontwarn okhttp3.** 50 | -dontwarn javax.annotation.** 51 | -dontwarn org.conscrypt.** 52 | # A resource is loaded with a relative path so the package of this class must be preserved. 53 | -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase 54 | 55 | # LifecycleObserver 56 | -keep class androidx.lifecycle.FullLifecycleObserver 57 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/src/main/java/com/transistorsoft/rnbackgroundgeolocation/RNBackgroundGeolocation.java: -------------------------------------------------------------------------------- 1 | package com.transistorsoft.rnbackgroundgeolocation; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import com.facebook.react.ReactPackage; 8 | import com.facebook.react.bridge.NativeModule; 9 | import com.facebook.react.bridge.ReactApplicationContext; 10 | import com.facebook.react.uimanager.ViewManager; 11 | import com.facebook.react.bridge.JavaScriptModule; 12 | 13 | /** 14 | * Created by chris on 2015-10-30. 15 | */ 16 | public class RNBackgroundGeolocation implements ReactPackage { 17 | @Override public List createNativeModules (ReactApplicationContext reactContext) { 18 | List modules = new ArrayList<>(); 19 | modules.add(new RNBackgroundGeolocationModule(reactContext)); 20 | return modules; 21 | } 22 | 23 | // Depreciated RN 0.47 24 | //@Override 25 | public List> createJSModules() { 26 | return Collections.emptyList(); 27 | } 28 | 29 | @Override 30 | public List createViewManagers(ReactApplicationContext reactContext) { 31 | return Collections.emptyList(); 32 | } 33 | } -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RNBackgroundGeolocation 3 | 4 | -------------------------------------------------------------------------------- /app.plugin.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./expo/plugin/build'); 2 | 3 | -------------------------------------------------------------------------------- /bin/actions.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs-extra') 2 | const path = require('path'); 3 | const rimraf = require("rimraf"); 4 | const chalk = require('chalk'); 5 | 6 | const { 7 | exec, 8 | spawn, 9 | CLIError 10 | } = require('./lib'); 11 | 12 | var args = process.argv.slice(2); 13 | const cmd = args.shift(); 14 | 15 | const PUBLIC_MODULE_NAME = "react-native-background-geolocation"; 16 | const PRIVATE_MODULE_NAME = "react-native-background-geolocation-android"; 17 | 18 | const COMMAND_MIRROR = 'mirror'; 19 | const COMMAND_TYPEDOC = 'typedoc'; 20 | const COMMAND_CP_DECLARATIONS = "cp-declarations" 21 | const COMMAND_PUBLISH = 'publish'; 22 | 23 | const IS_PRIVATE_REPO = process.cwd().split('/').pop() === PRIVATE_MODULE_NAME; 24 | 25 | const MENU = {}; 26 | 27 | function registerCommand(name, description, handler) { 28 | MENU[name] = { 29 | description: description, 30 | handler: handler 31 | }; 32 | } 33 | 34 | /// ACTION: mirror 35 | /// 36 | if (!IS_PRIVATE_REPO) { 37 | registerCommand(COMMAND_MIRROR, 'Mirror private repo into the public repo', function() { 38 | mirror(); 39 | }); 40 | } 41 | 42 | /// ACTION cp-declarations 43 | /// 44 | registerCommand(COMMAND_CP_DECLARATIONS, 'Copy the Typescript declarations from another project', function(args) { 45 | if (args.length < 1) { 46 | throw new CLIError('A src-path argument is required, eg: cp-declarations /path/to/other'); 47 | } 48 | return cpDeclarations(args); 49 | }); 50 | 51 | /// ACTION: typedoc 52 | /// 53 | registerCommand(COMMAND_TYPEDOC, 'Generate the typescript docs', function() { 54 | typedoc(); 55 | }); 56 | 57 | /// ACTION: publish 58 | /// 59 | registerCommand(COMMAND_PUBLISH, 'Prepare repo for publishing', function() { 60 | publish(); 61 | }); 62 | 63 | /// Prepare module for publishing 64 | /// 65 | async function publish() { 66 | if (!IS_PRIVATE_REPO) { 67 | await mirrorAsync(); 68 | } else { 69 | await typedoc(); 70 | } 71 | } 72 | 73 | /// Copy Typescript declarations from another repo 74 | /// 75 | function cpDeclarations(args) { 76 | const srcPath = args.shift(); 77 | const cmd = './scripts/cp-declarations ' + srcPath; 78 | return spawn(cmd); 79 | } 80 | 81 | /// Generate typedoc docs 82 | /// 83 | function typedoc() { 84 | const cmd = './scripts/generate-docs'; 85 | console.log('cmd: ', cmd); 86 | 87 | return spawn(cmd); 88 | } 89 | 90 | /// Mirror PRIVATE -> PUBLIC repo. 91 | /// 92 | async function mirror() { 93 | const SRC_PATH = path.join('..', PRIVATE_MODULE_NAME); 94 | console.log('- Mirroring ', SRC_PATH); 95 | var mirroredPaths = [ 96 | 'android', 97 | 'ios', 98 | 'src' 99 | ]; 100 | 101 | mirroredPaths.forEach(function(dir) { 102 | var src = path.join(SRC_PATH, dir); 103 | var dest = path.join('.', dir); 104 | console.log('- cp -R ', src, dest); 105 | fs.copySync(src, dest); 106 | }); 107 | 108 | try { 109 | await cpDeclarations([SRC_PATH]); 110 | await typedoc(); 111 | } catch (error) { 112 | throw error; 113 | } 114 | } 115 | 116 | 117 | module.exports = { 118 | actions: MENU 119 | }; 120 | -------------------------------------------------------------------------------- /bin/cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | 'use strict'; 4 | 5 | const {CLIError} = require('./lib'); 6 | 7 | const {actions} = require('./actions'); 8 | const chalk = require('chalk'); 9 | 10 | const COMMAND_HELP = 'help'; 11 | 12 | var args = process.argv.slice(2); 13 | var cmd = args.shift(); 14 | 15 | console.log(chalk.green("+-----------------------------------------")); 16 | console.log(chalk.green(`| [Transitorsoft Demo CLI] cmd: ${cmd}`)); 17 | console.log(chalk.green("+-----------------------------------------")); 18 | 19 | // Launch Command interpretor 20 | const CLI = (function() { 21 | return { 22 | init: function() { 23 | try { 24 | if (cmd === undefined) { 25 | cmd = COMMAND_HELP; 26 | } 27 | if (cmd === COMMAND_HELP) { 28 | printMenu(actions); 29 | return; 30 | } else if (actions[cmd] === undefined) { 31 | console.log(chalk.red("Unknown command:", cmd)); 32 | printMenu(actions); 33 | return; 34 | } 35 | 36 | actions[cmd].handler(args); 37 | 38 | } catch(error) { 39 | if (error instanceof CLIError) { 40 | console.log(chalk.red(`[error]: ${cmd}:`), error.message, '\n'); 41 | } else { 42 | throw error; 43 | } 44 | } 45 | } 46 | } 47 | })().init(); 48 | 49 | function printMenu(menu) { 50 | console.log('Available commands:'); 51 | var table = [{ 52 | command: COMMAND_HELP, 53 | description: 'Print this menu' 54 | }]; 55 | for (var action in menu) { 56 | //table[action] = ACTIONS[action].description; 57 | table.push({ 58 | command: action, 59 | description: menu[action].description 60 | }); 61 | } 62 | console.table(table, ['command', 'description']); 63 | } 64 | 65 | -------------------------------------------------------------------------------- /bin/lib.js: -------------------------------------------------------------------------------- 1 | const { exec, spawn} = require('child_process'); 2 | const chalk = require('chalk'); 3 | 4 | class CLIError extends Error {}; 5 | 6 | /** 7 | * Custom exec implemention with Promise 8 | * @return Promise 9 | */ 10 | function _exec(cmd, args) { 11 | 12 | } 13 | 14 | /** 15 | * Custom spawn implementation with Promise 16 | * @return Promise 17 | */ 18 | function _spawn(cmd, args=[]) { 19 | var message = cmd; 20 | args.forEach(function(arg) { message += ` ${arg}` }); 21 | 22 | console.log(chalk.yellow(`$ ${message}`)); 23 | 24 | return new Promise(function(resolve, reject) { 25 | 26 | const child = spawn(cmd, args, {shell: true, stdio: 'inherit'}); 27 | child.on('error', (chunk) => { 28 | console.log('error: ', chunk); 29 | }); 30 | 31 | child.on('close', (code) => { 32 | console.log(chalk.yellow(`child process exited with code ${code}`)); 33 | if (code == 0) { 34 | resolve(code); 35 | } else { 36 | reject(code); 37 | } 38 | }); 39 | }); 40 | } 41 | 42 | module.exports = { 43 | CLIError, 44 | exec: _exec, 45 | spawn: _spawn 46 | }; -------------------------------------------------------------------------------- /docs/.nojekyll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/.nojekyll -------------------------------------------------------------------------------- /docs/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/favicon.ico -------------------------------------------------------------------------------- /docs/assets/images/icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/icons.png -------------------------------------------------------------------------------- /docs/assets/images/icons.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/icons.psd -------------------------------------------------------------------------------- /docs/assets/images/icons@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/icons@2x.png -------------------------------------------------------------------------------- /docs/assets/images/logo-black-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/logo-black-150.png -------------------------------------------------------------------------------- /docs/assets/images/widgets-foo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/widgets-foo.png -------------------------------------------------------------------------------- /docs/assets/images/widgets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/widgets.png -------------------------------------------------------------------------------- /docs/assets/images/widgets.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/widgets.psd -------------------------------------------------------------------------------- /docs/assets/images/widgets@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/docs/assets/images/widgets@2x.png -------------------------------------------------------------------------------- /expo/plugin/src/iOSPlugin.ts: -------------------------------------------------------------------------------- 1 | import { 2 | ConfigPlugin, 3 | } from "@expo/config-plugins"; 4 | 5 | import { mergeContents } from "@expo/config-plugins/build/utils/generateCode"; 6 | 7 | type Props = {} 8 | 9 | export const withBackgroundGeolocationPluginIos: ConfigPlugin = (config, props={}) => { 10 | // Nothing to here here currently, but left for future considerations. 11 | return config; 12 | }; 13 | 14 | export default withBackgroundGeolocationPluginIos; 15 | -------------------------------------------------------------------------------- /expo/plugin/src/index.ts: -------------------------------------------------------------------------------- 1 | import { ConfigPlugin, withPlugins } from '@expo/config-plugins'; 2 | 3 | import androidPlugin from './androidPlugin'; 4 | import iOSPlugin from './iOSPlugin'; 5 | 6 | const withBackgroundGeolocation: ConfigPlugin< 7 | { 8 | //ext?:Map 9 | /** 10 | * Android license Default "" 11 | */ 12 | license?: string, 13 | /** 14 | * Huawei HMS license Default "" 15 | */ 16 | hmsLicense?: string, 17 | /** 18 | * Polygon Geofencing License Default "" 19 | */ 20 | polygonLicense?: string 21 | } | void 22 | > = (config, _props) => { 23 | const props = _props || {}; 24 | 25 | return withPlugins(config, [ 26 | [androidPlugin, { 27 | license: props.license, 28 | hmsLicense: props.hmsLicense, 29 | polygonLicense: props.polygonLicense 30 | }], 31 | [iOSPlugin, { 32 | // no props for ios currently. 33 | }] 34 | ]); 35 | }; 36 | 37 | export default withBackgroundGeolocation; 38 | -------------------------------------------------------------------------------- /expo/plugin/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "build", 4 | "rootDir": "src", 5 | "declaration": true, 6 | "target": "esnext", 7 | "module": "commonjs", 8 | "lib": ["esnext", "ES6", "DOM"], 9 | "allowJs": false, 10 | "jsx": "react-native", 11 | "sourceMap": true, 12 | "listEmittedFiles": true, 13 | "removeComments": false, 14 | "isolatedModules": false, 15 | "strict": true, 16 | "moduleResolution": "node", 17 | "allowSyntheticDefaultImports": true, 18 | "esModuleInterop": true, 19 | "skipLibCheck": true 20 | }, 21 | "exclude": ["node_modules"], 22 | "include": ["./src"] 23 | } 24 | -------------------------------------------------------------------------------- /help/INSTALL-IOS-COCOAPODS.md: -------------------------------------------------------------------------------- 1 | # iOS Installation with CocoaPods 2 | 3 | ### With `yarn` 4 | 5 | ```shell 6 | yarn add react-native-background-geolocation 7 | ``` 8 | 9 | ### With `npm` 10 | ```shell 11 | npm install react-native-background-geolocation --save 12 | ``` 13 | 14 | ### `Podfile` 15 | 16 | If you **don't** already have an `ios/Podfile` initialized, run the following command: 17 | ```shell 18 | $ cd ios 19 | $ pod init 20 | ``` 21 | 22 | Replace the contents of `Podfile` with the following, substituting `_YOUR_PROJECT_TARGET`: 23 | ```ruby 24 | # Uncomment the next line to define a global platform for your project 25 | # platform :ios, '9.0' 26 | 27 | target '_YOUR_PROJECT_TARGET_' do 28 | rn_path = '../node_modules/react-native' 29 | 30 | # See http://facebook.github.io/react-native/docs/integration-with-existing-apps.html#configuring-cocoapods-dependencies 31 | pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec" 32 | pod 'React', path: rn_path, subspecs: [ 33 | 'Core', 34 | 'CxxBridge', 35 | 'DevSupport', 36 | 'RCTActionSheet', 37 | 'RCTAnimation', 38 | 'RCTGeolocation', 39 | 'RCTImage', 40 | 'RCTLinkingIOS', 41 | 'RCTNetwork', 42 | 'RCTSettings', 43 | 'RCTText', 44 | 'RCTVibration', 45 | 'RCTWebSocket', 46 | ] 47 | 48 | # React Native third party dependencies podspecs 49 | pod 'DoubleConversion', :podspec => "#{rn_path}/third-party-podspecs/DoubleConversion.podspec" 50 | pod 'glog', :podspec => "#{rn_path}/third-party-podspecs/glog.podspec" 51 | # If you are using React Native <0.54, you will get the following error: 52 | # "The name of the given podspec `GLog` doesn't match the expected one `glog`" 53 | # Use the following line instead: 54 | #pod 'GLog', :podspec => "#{rn_path}/third-party-podspecs/GLog.podspec" 55 | pod 'Folly', :podspec => "#{rn_path}/third-party-podspecs/Folly.podspec" 56 | 57 | end 58 | 59 | post_install do |installer| 60 | installer.pods_project.targets.each do |target| 61 | if target.name == "React" 62 | target.remove_from_project 63 | end 64 | end 65 | end 66 | 67 | ``` 68 | 69 | ### `react-native link` 70 | 71 | Running `react-native link` will automatically install the plugin into your `Podfile`. 72 | 73 | - Follow the [`react-native link` instructions](./INSTALL-IOS-RNPM.md). 74 | - Install the new CocoaPods: 75 | 76 | ```shell 77 | $ cd ios 78 | $ pod install 79 | ``` 80 | -------------------------------------------------------------------------------- /help/INSTALL-IOS-RNPM.md: -------------------------------------------------------------------------------- 1 | # iOS Installation with `react-native link` 2 | 3 | ## `react-native <= 0.59` 4 | 5 | ### With `yarn` 6 | 7 | ```shell 8 | yarn add react-native-background-geolocation 9 | ``` 10 | 11 | ### With `npm` 12 | ```shell 13 | npm install react-native-background-geolocation --save 14 | ``` 15 | 16 | ## `react-native link` 17 | ```shell 18 | react-native link react-native-background-geolocation 19 | react-native link react-native-background-fetch 20 | ``` 21 | 22 | --------------------------------------------------------------- 23 | 24 | :warning: For those **not** using Cocoapods (you *should* be), where your iOS app does **not** have a `Podfile`: 25 | ```shell 26 | yarn add cocoa-lumberjack 27 | // 28 | npm install cocoa-lumberjack 29 | 30 | react-native link cocoa-lumberjack 31 | ``` 32 | 33 | The `cocoa-lumberjack` package is **deprecated** — it is no longer required when using *Cocoapods*. If you have `cocoa-lumberjack` installed and you're using `Cocoapods`, **remove and `unlink`** `cocoa-lumberjack`. 34 | 35 | --------------------------------------------------------------- 36 | 37 | ## `pod install` 38 | 39 | If you're using `Cocoapods` with your app: 40 | 41 | ```shell 42 | $ cd ios 43 | $ pod install 44 | ``` 45 | 46 | ## XCode Configuration 47 | 48 | - Edit **`Info.plist`**. The plugin adds default values for the following `plist` elements. You will need to change these values as desired. 49 | 50 | | Key | Value | Description | 51 | |-----|-------|-------------| 52 | | NSLocationAlwaysUsageDescription | This app requires background tracking | **Deprecated in iOS 11** The value here will be presented to the user when the plugin requests **Background Location** permission | 53 | | NSLocationAlwaysAndWhenInUseUsageDescription | This app requires background tracking | **New for iOS 11** The value here will be presented to the user when the plugin requests **Background Location** permission | 54 | | NSMotionUsageDescription | Accelerometer use increases battery efficiency by intelligently toggling location-tracking | The value here will be presented to the user when the app requests **Motion Activity** permission.| 55 | 56 | ![](https://dl.dropboxusercontent.com/s/j7udsab7brlj4yk/Screenshot%202016-09-22%2008.33.53.png?dl=1) 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /help/PRIVACY_POLICY.md: -------------------------------------------------------------------------------- 1 | Privacy Policy 2 | ------------------------------------------------------------------ 3 | 4 | `react-native-background-geolocation` ("The Plugin") does not upload *any* information to third-party services. The plugin's HTTP Service will upload recorded locations *only* to the host *you* configure with [Config.url](https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.config.html#url) option. 5 | 6 | The Plugin automatically destroys locally recorded locations in its SQLite database which have not yet been uploaded to your configured [url](https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.config.html#url) after a period of [#maxDaysToPersist](https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.config.html#maxdaystopersist). 7 | 8 | If you *have* configured the plugin with an [url](https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.config.html#url) to your server, the plugin automatically destroys each locally persisted location in its SQLite database when your server returns a success response (eg: `200`). 9 | 10 | For more information, see the [HTTP Guide](https://transistorsoft.github.io/react-native-background-geolocation/interfaces/_react_native_background_geolocation_.httpevent.html). -------------------------------------------------------------------------------- /help/timing-diagram.md: -------------------------------------------------------------------------------- 1 | 2 | ________________________________ 3 | App awake? |___ <-- iOS has suspended the app when stop-detection expires 4 | __________ . 5 | GPS ON? |_____________________.___ 6 | . . 7 | .<-- GPS OFF when stop-detection engages (to conserve battery) 8 | ___ . . 9 | motion-state moving? |____________________________.___ 10 | . . . 11 | . . . 12 | ........ . 13 | stopDetectionDelay: ___| |_____________________.___ 14 | . . 15 | . . 16 | begin stop-detection -->. .<-- end stop-detection 17 | ._____________________. 18 | stop-detection engage: __________| |___ 19 | . . 20 | .start .expire 21 | . . 22 | ....................... 23 | stopTimeout: __________| |___ 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/RNBackgroundGeolocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNBackgroundGeolocation.h 3 | // RNBackgroundGeolocation 4 | // 5 | // Created by Christopher Scott on 2015-04-19. 6 | // Copyright (c) 2015 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | @interface RNBackgroundGeolocation : RCTEventEmitter 18 | 19 | @property (nonatomic, strong) TSLocationManager* locationManager; 20 | 21 | @end 22 | 23 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | AvailableLibraries 6 | 7 | 8 | BinaryPath 9 | TSLocationManager.framework/TSLocationManager 10 | LibraryIdentifier 11 | ios-arm64 12 | LibraryPath 13 | TSLocationManager.framework 14 | SupportedArchitectures 15 | 16 | arm64 17 | 18 | SupportedPlatform 19 | ios 20 | 21 | 22 | BinaryPath 23 | TSLocationManager.framework/Versions/A/TSLocationManager 24 | LibraryIdentifier 25 | ios-arm64_x86_64-maccatalyst 26 | LibraryPath 27 | TSLocationManager.framework 28 | SupportedArchitectures 29 | 30 | arm64 31 | x86_64 32 | 33 | SupportedPlatform 34 | ios 35 | SupportedPlatformVariant 36 | maccatalyst 37 | 38 | 39 | BinaryPath 40 | TSLocationManager.framework/TSLocationManager 41 | LibraryIdentifier 42 | ios-arm64_x86_64-simulator 43 | LibraryPath 44 | TSLocationManager.framework 45 | SupportedArchitectures 46 | 47 | arm64 48 | x86_64 49 | 50 | SupportedPlatform 51 | ios 52 | SupportedPlatformVariant 53 | simulator 54 | 55 | 56 | CFBundlePackageType 57 | XFWK 58 | XCFrameworkFormatVersion 59 | 1.0 60 | 61 | 62 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/AtomicBoolean.h: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicBoolean.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-11-14. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// :nodoc: 12 | @interface AtomicBoolean : NSObject 13 | - (instancetype)initWithValue:(BOOL)value; 14 | - (BOOL)getValue; 15 | - (void)setValue:(BOOL)value; 16 | - (BOOL)compareTo:(BOOL)expected andSetValue:(BOOL)value; 17 | - (BOOL)getAndSetValue:(BOOL)value; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/ConfigModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConfigModule.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /// :nodoc: 11 | @interface ConfigModule:NSObject 12 | 13 | //-(NSDictionary*) toDictionary; 14 | +(instancetype) createWithDictionary:(NSDictionary*)values; 15 | 16 | -(NSDictionary*) toDictionary; 17 | -(NSDictionary*) toDictionary:(BOOL)redact; 18 | -(BOOL) isEqual; 19 | - (id) valueFromDictionary:(NSDictionary*)values forKey:(NSString*)key forObject:(id)object defaultValue:(id)defaultValue; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/HttpRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "HttpResponse.h" 10 | 11 | @interface HttpRequest : NSObject 12 | 13 | @property(nonatomic) id requestData; 14 | @property(nonatomic) NSURL *url; 15 | 16 | +(void) execute:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 17 | 18 | -(instancetype) initWithRecords:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/HttpResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | // Location types 11 | typedef enum TSHttpServiceError : NSInteger { 12 | TSHttpServiveErrorInvalidUrl = 1, 13 | TSHttpServiceErrorNetworkConnection = 2, 14 | TSHttpServiceErrorSyncInProgress = 3, 15 | TSHttpServiceErrorResponse = 4, 16 | TSHttpServiceRedirectError = 5 17 | } TSHttpServiceError; 18 | 19 | @interface HttpResponse : NSObject 20 | 21 | -(instancetype) initWithData:(NSData*)data response:(NSURLResponse*)response error:(NSError*)error; 22 | 23 | @property(nonatomic) NSError* error; 24 | @property(nonatomic) NSData *data; 25 | @property(nonatomic) NSHTTPURLResponse *response; 26 | @property(nonatomic) NSInteger status; 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/LocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CurrentPositionManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2015-12-07. 6 | // Copyright © 2015 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import "TSWatchPositionRequest.h" 13 | #import "TSCurrentPositionRequest.h" 14 | 15 | /// :nodoc: 16 | @interface LocationManager : NSObject 17 | 18 | // Error codes 19 | typedef enum tsLocationError : NSInteger { 20 | TS_LOCATION_ERROR_ACCEPTABLE_ACCURACY = 100, 21 | TS_LOCATION_ERROR_TIMEOUT = 408 22 | } tsLocationError; 23 | 24 | @property (readonly) NSInteger currentAttempts; 25 | @property (atomic) NSTimer *timeoutTimer; 26 | @property (atomic) NSTimer *watchPositionTimer; 27 | @property (atomic, readonly) NSTimeInterval locationTimeout; 28 | 29 | @property (atomic, readonly) BOOL isAcquiringBackgroundTime; 30 | @property (atomic, readonly) NSTimer *preventSuspendTimer; 31 | 32 | @property (strong, atomic, readonly) CLLocationManager* locationManager; 33 | @property (atomic, readonly) UIBackgroundTaskIdentifier preventSuspendTask; 34 | @property (strong, atomic, readonly) CLLocation* lastLocation; 35 | @property (strong, atomic, readonly) CLLocation* bestLocation; 36 | @property (atomic) NSInteger maxLocationAttempts; 37 | @property (atomic) CLLocationDistance distanceFilter; 38 | @property (atomic) CLLocationAccuracy desiredAccuracy; 39 | @property (atomic) CLActivityType activityType; 40 | @property (readonly) BOOL isUpdating; 41 | @property (readonly) BOOL isWatchingPosition; 42 | 43 | @property (copy) void (^locationChangedBlock) (LocationManager* manager, CLLocation* location, BOOL isSample); 44 | @property (copy) void (^errorBlock) (LocationManager* manager, NSError* error); 45 | 46 | -(void)watchPosition:(TSWatchPositionRequest*)request; 47 | -(void)requestLocation; 48 | -(void)stopWatchPosition; 49 | -(void)startUpdatingLocation; 50 | -(void)startUpdatingLocation:(NSInteger)samples; 51 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout; 52 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout desiredAccuracy:(CLLocationAccuracy)desiredAccuracy; 53 | -(void)stopUpdatingLocation; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/LogQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "SQLQuery.h" 10 | 11 | @interface LogQuery:SQLQuery 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/SQLQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // SQLQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | typedef enum SQLQueryOrder : NSInteger { 10 | tsSQLQueryOrderDESC = -1, 11 | tsSQLQueryOrderASC = 1 12 | } SQLQueryOrder; 13 | 14 | @interface SQLQuery : NSObject 15 | { 16 | @protected 17 | NSString *_tableName; 18 | NSString *_orderColumn; 19 | NSString *_timestampColumn; 20 | } 21 | 22 | @property (nonatomic) double start; 23 | @property (nonatomic) double end; 24 | @property (nonatomic) int limit; 25 | @property (nonatomic) SQLQueryOrder order; 26 | 27 | - (instancetype) initWithDictionary:(NSDictionary*)params; 28 | 29 | - (NSString*) render; 30 | - (NSArray*) arguments; 31 | - (NSString*) toString; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSActivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSActivityChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSActivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger confidence; 12 | @property (nonatomic, readonly) NSString *activity; 13 | 14 | -(id) initWithActivityName:(NSString*)activityName confidence:(NSInteger)confidence; 15 | -(NSDictionary*) toDictionary; 16 | @end 17 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSAuthorization.h: -------------------------------------------------------------------------------- 1 | // 2 | // Authorization.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "ConfigModule.h" 10 | #import "TransistorAuthorizationToken.h" 11 | #import "TSAuthorizationEvent.h" 12 | 13 | extern NSString * const TS_AUTHORIZATION_STRATEGY; 14 | extern NSString * const TS_ACCESS_TOKEN; 15 | extern NSString * const TS_REFRESH_TOKEN; 16 | extern NSString * const TS_REFRESH_PAYLOAD; 17 | extern NSString * const TS_EXPIRES; 18 | extern NSString * const TS_REFRESH_URL; 19 | 20 | @interface TSAuthorization:ConfigModule 21 | 22 | @property(nonatomic) NSString* strategy; 23 | @property(nonatomic) NSString* accessToken; 24 | @property(nonatomic) NSString* refreshToken; 25 | @property(nonatomic) NSDictionary* refreshPayload; 26 | @property(nonatomic) NSDictionary* refreshHeaders; 27 | @property(nonatomic) NSString* refreshUrl; 28 | @property(nonatomic) NSTimeInterval expires; 29 | 30 | - (instancetype) initWithDictionary:(NSDictionary*)values; 31 | 32 | - (void) apply:(NSMutableURLRequest*)request; 33 | - (NSString*) toString; 34 | - (void) resolve:(NSInteger)status success:(void(^)(TSAuthorizationEvent*))success failure:(void(^)(TSAuthorizationEvent*))failure; 35 | 36 | @end 37 | 38 | 39 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSAuthorizationEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSAuthorizationEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-26. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | 9 | @interface TSAuthorizationEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger status; 12 | @property (nonatomic, readonly) NSError* error; 13 | @property (nonatomic, readonly) NSDictionary *response; 14 | 15 | -(instancetype) initWithResponse:(NSDictionary*)response status:(NSInteger)status; 16 | -(instancetype) initWithError:(NSError*)error status:(NSInteger)status; 17 | -(NSDictionary*) toDictionary; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSCallback.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCallback.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-31. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSCallback : NSObject 10 | 11 | @property (nonatomic, copy) void (^success)(id); 12 | @property (nonatomic, copy) void (^failure)(id); 13 | @property (nonatomic, readonly) NSDictionary *options; 14 | 15 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure; 16 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure options:(NSDictionary*)options; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSConnectivityChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSConnectivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL hasConnection; 12 | 13 | -(instancetype) initWithHasConnection:(BOOL)hasConnection; 14 | -(NSDictionary*) toDictionary; 15 | @end 16 | 17 | 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCurrentPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-11. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSCurrentPositionRequest : NSObject 11 | 12 | @property (atomic) NSTimeInterval timeout; 13 | @property (atomic) double maximumAge; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) int samples; 16 | @property (atomic) CLLocationAccuracy desiredAccuracy; 17 | @property (atomic) NSDictionary* extras; 18 | @property (atomic, copy) void (^success)(TSLocation*); 19 | @property (atomic, copy) void (^failure)(NSError*); 20 | 21 | -(instancetype) init; 22 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 23 | 24 | -(instancetype) initWithPersist:(BOOL)persist 25 | success:(void (^)(TSLocation*))success 26 | failure:(void (^)(NSError*))failure; 27 | 28 | -(instancetype) initWithPersist:(BOOL)persist 29 | samples:(int)samples 30 | success:(void (^)(TSLocation*))success 31 | failure:(void (^)(NSError*))failure; 32 | 33 | -(instancetype) initWithTimeout:(int)timeout 34 | maximumAge:(double)maximumAge 35 | persist:(BOOL)persist 36 | samples:(int)samples 37 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 38 | extras:(NSDictionary*)extras 39 | success:(void (^)(TSLocation*))success 40 | failure:(void (^)(NSError*))failure; 41 | 42 | @end 43 | 44 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSDeviceInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceInfo.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | @interface TSDeviceInfo:NSObject 12 | 13 | + (TSDeviceInfo *)sharedInstance; 14 | 15 | @property(nonatomic) NSString* model; 16 | @property(nonatomic) NSString* manufacturer; 17 | @property(nonatomic) NSString* platform; 18 | @property(nonatomic) NSString* version; 19 | 20 | -(NSDictionary*) toDictionary; 21 | -(NSDictionary*) toDictionary:(NSString*)framework; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSEnabledChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSEnabledChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL enabled; 12 | -(instancetype) initWithEnabled:(BOOL)enabled; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofence.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofence.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-12-21. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface TSGeofence : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSString* identifier; 15 | @property (nonatomic) CLLocationDistance radius; 16 | 17 | @property (nonatomic) CLLocationDegrees latitude; 18 | @property (nonatomic) CLLocationDegrees longitude; 19 | @property (nonatomic) BOOL notifyOnEntry; 20 | @property (nonatomic) BOOL notifyOnExit; 21 | @property (nonatomic) BOOL notifyOnDwell; 22 | @property (nonatomic) double loiteringDelay; 23 | @property (nonatomic) NSDictionary* extras; 24 | @property (nonatomic) NSArray* vertices; 25 | /** 26 | * Arbitrary extra data attached to the geofence 27 | */ 28 | 29 | -(instancetype) initWithIdentifier:(NSString*)identifier 30 | radius:(CLLocationDistance)radius 31 | latitude:(CLLocationDegrees)latitude 32 | longitude:(CLLocationDegrees)lontitude 33 | notifyOnEntry:(BOOL)notifyOnEntry 34 | notifyOnExit:(BOOL)notifyOnExit 35 | notifyOnDwell:(BOOL)notifyOnDwell 36 | loiteringDelay:(double)loiteringDelay; 37 | 38 | -(instancetype) initWithIdentifier:(NSString*)identifier 39 | radius:(CLLocationDistance)radius 40 | latitude:(CLLocationDegrees)latitude 41 | longitude:(CLLocationDegrees)longitude 42 | notifyOnEntry:(BOOL)notifyOnEntry 43 | notifyOnExit:(BOOL)notifyOnExit 44 | notifyOnDwell:(BOOL)notifyOnDwell 45 | loiteringDelay:(double)loiteringDelay 46 | extras:(NSDictionary*)extras 47 | vertices:(NSArray*)vertices; 48 | 49 | - (NSDictionary*) toDictionary; 50 | - (BOOL) isPolygon; 51 | 52 | 53 | @end 54 | 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofenceEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofenceEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-03-27. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TSLocation.h" 11 | #import "TSGeofence.h" 12 | 13 | /** 14 | The event object provided to `-[TSLocationManager onGeofence:]` 15 | 16 | ```obj-c 17 | TSLocationManager *bgGeo = [TSLocationManager sharedInstance]; 18 | [bgGeo onGeofence:^(TSGeofenceEvent *event) { 19 | NSLog(@"[onGeofence]: %@", event); 20 | }]; 21 | ``` 22 | 23 | */ 24 | @interface TSGeofenceEvent : NSObject 25 | { 26 | 27 | } 28 | 29 | /// The location associated with this geofence event. 30 | @property (nonatomic, readonly) TSLocation* location; 31 | /// The triggered geofence 32 | @property (nonatomic, readonly) TSGeofence* geofence; 33 | /// The region instance. 34 | @property (nonatomic, readonly) CLCircularRegion* region; 35 | 36 | @property (nonatomic) NSDate *timestamp; 37 | 38 | /// The geofence transition (eg: "ENTER", "EXIT", "DWELL" 39 | @property (nonatomic, readonly) NSString* action; 40 | /// :nodoc: 41 | @property (nonatomic, readonly) BOOL isLoitering; 42 | 43 | /// :nodoc: 44 | @property (nonatomic, readonly) BOOL isFinishedLoitering; 45 | 46 | /// :nodoc: 47 | -(instancetype)initWithGeofence:(TSGeofence*)geofence region:(CLCircularRegion*)circularRegion action:(NSString*)actionName; 48 | -(instancetype)initWithGeofence:(TSGeofence*)geofence action:(NSString*)actionName; 49 | 50 | /// :nodoc: 51 | -(void) startLoiteringAt:(CLLocation*)location callback:(void (^)(void))callback; 52 | /// :nodoc: 53 | -(BOOL) isLoiteringAt:(CLLocation*)location; 54 | /// :nodoc: 55 | -(void) setTriggerLocation:(CLLocation*)location; 56 | /// :nodoc: 57 | -(void) cancel; 58 | 59 | /// Returns an `NSDictionary` representaton. 60 | -(NSDictionary*)toDictionary; 61 | 62 | 63 | @end 64 | 65 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofenceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeofenceManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-10-04. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "TSGeofenceEvent.h" 12 | #import "TSGeofencesChangeEvent.h" 13 | 14 | extern NSString *const STATIONARY_REGION_IDENTIFIER; 15 | 16 | @interface TSGeofenceManager : NSObject 17 | { 18 | 19 | } 20 | 21 | @property (copy) void (^onGeofence) (TSGeofenceEvent* event); 22 | 23 | @property (atomic) BOOL isMoving; 24 | @property (atomic) BOOL enabled; 25 | @property (atomic) BOOL evaluated; 26 | @property (atomic) BOOL isUpdatingLocation; 27 | @property (atomic) BOOL isEvaluatingEvents; 28 | @property (atomic) BOOL isRequestingLocation; 29 | @property (atomic) BOOL isMonitoringSignificantChanges; 30 | @property (atomic) BOOL willEvaluateProximity; 31 | @property (atomic) CLLocation *lastLocation; 32 | 33 | @property (atomic, readonly) NSMutableArray *geofencesChangeListeners; 34 | @property (atomic, readonly) NSMutableArray *geofenceListeners; 35 | 36 | 37 | // Event listeners 38 | -(void) onGeofencesChange:(void (^)(TSGeofencesChangeEvent*))success; 39 | -(void) onGeofence:(void (^)(TSGeofenceEvent*))success; 40 | -(void) un:(NSString*)event callback:(void(^)(id))callback; 41 | -(void) removeListeners; 42 | -(void) start; 43 | -(void) stop; 44 | -(void) ready; 45 | -(void) setLocation:(CLLocation*)location isMoving:(BOOL)isMoving; 46 | -(void) setProximityRadius:(CLLocationDistance)radius; 47 | -(BOOL) isMonitoringRegion:(CLCircularRegion*)region; 48 | -(void) didBecomeStationary:(CLLocation*)locaiton; 49 | -(NSString*) identifierFor:(CLCircularRegion*)region; 50 | -(void) create:(NSArray*)geofences success:(void (^)(void))success failure:(void (^)(NSString*))failure; 51 | -(void) destroy:(NSArray*)identifiers success:(void (^)(void))success failure:(void (^)(NSString*))failure; 52 | -(BOOL) isInfiniteMonitoring; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofencesChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSGeofencesChangeEvent : NSObject 11 | 12 | @property (nonatomic, readonly) NSArray* on; 13 | @property (nonatomic, readonly) NSArray* off; 14 | 15 | -(id) initWithOn:(NSArray*)on off:(NSArray*)off; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHeartbeatEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHeartbeat.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "TSLocation.h" 10 | 11 | @interface TSHeartbeatEvent : NSObject 12 | 13 | @property (nonatomic, readonly) TSLocation* location; 14 | 15 | -(id) initWithLocation:(CLLocation*)location; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHttpEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSHttpEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isSuccess; 12 | @property (nonatomic, readonly) NSInteger statusCode; 13 | @property (nonatomic, readonly) NSDictionary *requestData; 14 | @property (nonatomic, readonly) NSString *responseText; 15 | @property (nonatomic, readonly) NSError *error; 16 | 17 | -(id) initWithStatusCode:(NSInteger)statusCode requestData:(NSDictionary*)requestData responseData:(NSData*)responseData error:(NSError*)error; 18 | -(NSDictionary*) toDictionary; 19 | @end 20 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSHttpService.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduler.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-04-26. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | // 9 | // TSScheduler 10 | // TODO This should be decoupled into some sort of plugin 11 | // 12 | #import 13 | #import 14 | #import "TSConnectivityChangeEvent.h" 15 | #import "TSAuthorizationEvent.h" 16 | #import "AtomicBoolean.h" 17 | #import "HttpRequest.h" 18 | #import "TSReachability.h" 19 | #import "TSCallback.h" 20 | 21 | @class TSHttpService; 22 | 23 | @interface TSHttpService : NSObject 24 | 25 | #pragma mark - Singleton 26 | + (TSHttpService *)sharedInstance; 27 | 28 | #pragma mark - Properties 29 | 30 | @property (copy) void (^httpResponseBlock) (HttpRequest *request, HttpResponse *response); 31 | 32 | @property (nonatomic) AtomicBoolean *isBusy; 33 | @property (nonatomic) BOOL hasNetworkConnection; 34 | 35 | @property (nonatomic, readonly) NSMutableArray *syncedRecords; 36 | @property (nonatomic, readonly) TSReachability *reachability; 37 | @property (nonatomic, readonly) UIBackgroundTaskIdentifier bgTask; 38 | 39 | @property (nonatomic, readonly) NSMutableSet *connectivityChangeListeners; 40 | @property (nonatomic, readonly) NSMutableSet *authorizationListeners; 41 | 42 | @property (nonatomic) TSCallback *callback; 43 | @property (nonatomic) long autoSyncThreshold; 44 | 45 | #pragma mark - Methods 46 | -(void)flush; 47 | -(void)flush:(BOOL)overrideSyncThreshold; 48 | -(void)flush:(void(^)(NSArray*))success failure:(void(^)(NSError*))failure; 49 | -(void)startMonitoring; 50 | -(void)stopMonitoring; 51 | 52 | -(void)onConnectivityChange:(void (^)(TSConnectivityChangeEvent*))success; 53 | -(void)onAuthorization:(void(^)(TSAuthorizationEvent*))callback; 54 | -(void)un:(NSString*)event callback:(void(^)(id))callback; 55 | -(void)removeListeners; 56 | -(void)removeListeners:(NSString*)event; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSLocation.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-02-11. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSLocation : NSObject 10 | 11 | // Location types 12 | typedef enum tsLocationType : NSInteger { 13 | TS_LOCATION_TYPE_MOTIONCHANGE = 0, 14 | TS_LOCATION_TYPE_TRACKING = 1, 15 | TS_LOCATION_TYPE_CURRENT = 2, 16 | TS_LOCATION_TYPE_SAMPLE = 3, 17 | TS_LOCATION_TYPE_WATCH = 4, 18 | TS_LOCATION_TYPE_GEOFENCE = 5, 19 | TS_LOCATION_TYPE_HEARTBEAT = 6 20 | } tsLocationtype; 21 | 22 | /** 23 | * The native CLLocation instance 24 | */ 25 | @property (nonatomic, readonly) CLLocation* location; 26 | /** 27 | * Universally unique identifier. The uuid is used to locate the record in the database. It is also posted by default in HTTP requests so your server can determine if a duplicate location has been posted. It's also helpful to match a location received at your server to entries in the plugin logs. 28 | */ 29 | @property (nonatomic, readonly) NSString *uuid; 30 | /** 31 | * The rendered timestamp in ISO-8851 UTC format (YYYY-MM-dd HH:mm:sssZ) 32 | */ 33 | @property (nonatomic, readonly) NSString *timestamp; 34 | 35 | @property (nonatomic, readonly) NSNumber *age; 36 | /** 37 | * The type of location: MOTIONCHANGE|TRACKING|CURRENT|SAMPLE|WATCH|GEOFENCE|HEARTBEAT 38 | */ 39 | @property (nonatomic, readonly) enum tsLocationType type; 40 | /** 41 | * YES when location was recorded while device is in motion; NO otherwise. 42 | */ 43 | @property (nonatomic, readonly) BOOL isMoving; 44 | /** 45 | * Arbitrary extras data attached to the location. 46 | */ 47 | @property (nonatomic, readonly) NSDictionary* extras; 48 | /** 49 | * For internal use only. Geofence data rendered to NSDictionary for posting to server. 50 | */ 51 | @property (nonatomic, readonly) NSDictionary* geofence; 52 | // Battery 53 | /** 54 | * YES when device is plugged into power and charging 55 | */ 56 | @property (nonatomic, readonly) BOOL batteryIsCharging; 57 | /** 58 | * The battery level between 0 (empty) and 1 (full) 59 | */ 60 | @property (nonatomic, readonly) NSNumber *batteryLevel; 61 | // Activity 62 | /** 63 | * Activity type rendered as string: still|on_foot|in_vehicle|running|on_bicycle 64 | */ 65 | @property (nonatomic, readonly) NSString *activityType; 66 | /** 67 | * Confidence of activity-type estimation as % 0-100 68 | */ 69 | @property (nonatomic, readonly) NSNumber *activityConfidence; 70 | // State 71 | /** 72 | * YES when recorded location is a sample. The plugin records multiple locations for particular events, such as "motionchange" in order to determine 73 | * highest accuracy location before persisting that location to the database and POSTing to your configured #url. Location "samples" are not persisted 74 | * to the plugin's database, nor are they posted to your configured #url 75 | */ 76 | @property (nonatomic, readonly) BOOL isSample; 77 | 78 | @property (nonatomic, readonly) BOOL mock; 79 | /** 80 | * YES when this location was provided to a heartbeat event 81 | */ 82 | @property (nonatomic, readonly) BOOL isHeartbeat; 83 | /** 84 | * The current value of the odometer in meters 85 | */ 86 | @property (nonatomic, readonly) NSNumber *odometer; 87 | /** 88 | * The event associated with this location: location|motionchange|heartbeat|providerchange 89 | */ 90 | @property (nonatomic, readonly) NSString *event; 91 | 92 | -(instancetype) initWithLocation:(CLLocation*)location; 93 | -(instancetype) initWithLocation:(CLLocation*)location type:(enum tsLocationType)type extras:(NSDictionary*)extras; 94 | -(instancetype) initWithLocation:(CLLocation*)location geofence:(NSDictionary*)geofenceData; 95 | 96 | /** 97 | * Render location-data as JSON string 98 | */ 99 | - (NSData*)toJson:(NSError**)error; 100 | /** 101 | * Render location-data as NSDictionary 102 | */ 103 | - (NSDictionary*)toDictionary; 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSPowerSaveChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-09-18. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSPowerSaveChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isPowerSaveMode; 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSProviderChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSProviderChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSProviderChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) CLAuthorizationStatus status; 12 | @property (nonatomic, readonly) NSInteger accuracyAuthorization; 13 | @property (nonatomic, readonly) BOOL gps; 14 | @property (nonatomic, readonly) BOOL network; 15 | @property (nonatomic, readonly) BOOL enabled; 16 | @property (nonatomic, readonly) CLLocationManager* manager; 17 | 18 | -(id) initWithManager:(CLLocationManager*)manager status:(CLAuthorizationStatus)status authorizationRequest:(NSString*)authorizationRequest; 19 | -(NSDictionary*) toDictionary; 20 | @end 21 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSSchedule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSSchedule.h 3 | // BG Geo 4 | // 5 | // Created by Christopher Scott on 2016-04-25. 6 | // 7 | // 8 | #import "TSConfig.h" 9 | 10 | @interface TSSchedule : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSDateComponents* onTime; 15 | @property (nonatomic) NSDate* onDate; 16 | 17 | @property (nonatomic) NSDateComponents* offTime; 18 | @property (nonatomic) NSDate* offDate; 19 | @property (nonatomic) BOOL triggered; 20 | @property (nonatomic) TSTrackingMode trackingMode; 21 | 22 | @property (copy) void (^handlerBlock) (TSSchedule *schedule); 23 | 24 | -(instancetype)initWithRecord:(NSString*)data andHandler:(void (^)(TSSchedule*))handler; 25 | 26 | -(void)make:(NSDateComponents*)NSDateComponents; 27 | -(BOOL)isNext:(NSDate*)now; 28 | -(BOOL)isLiteralDate; 29 | -(BOOL)hasDay:(NSInteger)day; 30 | -(BOOL)startsBefore:(NSDate*)now; 31 | -(BOOL)startsAfter:(NSDate*)now; 32 | -(BOOL)endsBefore:(NSDate*)now; 33 | -(BOOL)endsAfter:(NSDate*)now; 34 | -(BOOL)expired; 35 | -(void)trigger:(BOOL)enabled; 36 | -(void)reset; 37 | -(void)evaluate; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSScheduleEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduleEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSScheduleEvent : NSObject 11 | 12 | @property (nonatomic, readonly) TSSchedule* schedule; 13 | @property (nonatomic, readonly) NSDictionary* state; 14 | 15 | -(id) initWithSchedule:(TSSchedule*)schedule state:(NSDictionary*)state; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TSWatchPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSWatchPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-12. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSWatchPositionRequest : NSObject 11 | 12 | @property (nonatomic) double interval; 13 | @property (atomic) CLLocationAccuracy desiredAccuracy; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) NSDictionary* extras; 16 | @property (atomic) double timeout; 17 | @property (atomic, copy) void (^success)(TSLocation*); 18 | @property (atomic, copy) void (^failure)(NSError*); 19 | 20 | -(instancetype) init; 21 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 22 | 23 | -(instancetype) initWithInterval:(double)interval 24 | success:(void (^)(TSLocation*))success 25 | failure:(void (^)(NSError*))failure; 26 | 27 | -(instancetype) initWithInterval:(double)interval 28 | persist:(BOOL)persist 29 | success:(void (^)(TSLocation*))success 30 | failure:(void (^)(NSError*))failure; 31 | 32 | -(instancetype) initWithInterval:(double)interval 33 | persist:(BOOL)persist 34 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 35 | extras:(NSDictionary*)extras 36 | timeout:(double)timeout 37 | success:(void (^)(TSLocation*))success 38 | failure:(void (^)(NSError*))failure; 39 | 40 | @end 41 | 42 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransistorAuthorizationToken.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /** 11 | * TransistorAuthorizationToken for demo server tracker.transistorsoft.com 12 | */ 13 | @interface TransistorAuthorizationToken:NSObject 14 | 15 | @property (nonatomic) NSString* accessToken; 16 | @property (nonatomic) NSString* refreshToken; 17 | @property (nonatomic) long expires; 18 | 19 | + (void) findOrCreateWithOrg:(NSString*)orgname username:(NSString*)username url:(NSString*)apiUrl framework:(NSString*)framework success:(void(^)(TransistorAuthorizationToken*))success failure:(void(^)(NSError*))error; 20 | + (void) destroyWithUrl:(NSString*)url; 21 | + (BOOL) hasTokenForHost:(NSString*)host; 22 | 23 | - (instancetype) initWithAccessToken:(NSString*)accessToken refreshToken:(NSString*)refreshToken expires:(long)expires; 24 | - (instancetype) initWithDictionary:(NSDictionary*)data; 25 | 26 | -(NSDictionary*) toDictionary; 27 | 28 | @end 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Info.plist -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TSLocationManager { 2 | umbrella header "TSLocationManager.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | NSPrivacyTrackingDomains 13 | 14 | 15 | NSPrivacyAccessedAPITypes 16 | 17 | 18 | NSPrivacyAccessedAPIType 19 | NSPrivacyAccessedAPICategoryUserDefaults 20 | 21 | NSPrivacyAccessedAPITypeReasons 22 | 23 | CA92.1 24 | 1C8F.1 25 | 26 | 27 | 28 | 29 | NSPrivacyCollectedDataTypes 30 | 31 | 32 | NSPrivacyTracking 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/TSLocationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/TSLocationManager -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64/TSLocationManager.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/AtomicBoolean.h: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicBoolean.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-11-14. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// :nodoc: 12 | @interface AtomicBoolean : NSObject 13 | - (instancetype)initWithValue:(BOOL)value; 14 | - (BOOL)getValue; 15 | - (void)setValue:(BOOL)value; 16 | - (BOOL)compareTo:(BOOL)expected andSetValue:(BOOL)value; 17 | - (BOOL)getAndSetValue:(BOOL)value; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/ConfigModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConfigModule.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /// :nodoc: 11 | @interface ConfigModule:NSObject 12 | 13 | //-(NSDictionary*) toDictionary; 14 | +(instancetype) createWithDictionary:(NSDictionary*)values; 15 | 16 | -(NSDictionary*) toDictionary; 17 | -(NSDictionary*) toDictionary:(BOOL)redact; 18 | -(BOOL) isEqual; 19 | - (id) valueFromDictionary:(NSDictionary*)values forKey:(NSString*)key forObject:(id)object defaultValue:(id)defaultValue; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "HttpResponse.h" 10 | 11 | @interface HttpRequest : NSObject 12 | 13 | @property(nonatomic) id requestData; 14 | @property(nonatomic) NSURL *url; 15 | 16 | +(void) execute:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 17 | 18 | -(instancetype) initWithRecords:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/HttpResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | // Location types 11 | typedef enum TSHttpServiceError : NSInteger { 12 | TSHttpServiveErrorInvalidUrl = 1, 13 | TSHttpServiceErrorNetworkConnection = 2, 14 | TSHttpServiceErrorSyncInProgress = 3, 15 | TSHttpServiceErrorResponse = 4, 16 | TSHttpServiceRedirectError = 5 17 | } TSHttpServiceError; 18 | 19 | @interface HttpResponse : NSObject 20 | 21 | -(instancetype) initWithData:(NSData*)data response:(NSURLResponse*)response error:(NSError*)error; 22 | 23 | @property(nonatomic) NSError* error; 24 | @property(nonatomic) NSData *data; 25 | @property(nonatomic) NSHTTPURLResponse *response; 26 | @property(nonatomic) NSInteger status; 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CurrentPositionManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2015-12-07. 6 | // Copyright © 2015 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import "TSWatchPositionRequest.h" 13 | #import "TSCurrentPositionRequest.h" 14 | 15 | /// :nodoc: 16 | @interface LocationManager : NSObject 17 | 18 | // Error codes 19 | typedef enum tsLocationError : NSInteger { 20 | TS_LOCATION_ERROR_ACCEPTABLE_ACCURACY = 100, 21 | TS_LOCATION_ERROR_TIMEOUT = 408 22 | } tsLocationError; 23 | 24 | @property (readonly) NSInteger currentAttempts; 25 | @property (atomic) NSTimer *timeoutTimer; 26 | @property (atomic) NSTimer *watchPositionTimer; 27 | @property (atomic, readonly) NSTimeInterval locationTimeout; 28 | 29 | @property (atomic, readonly) BOOL isAcquiringBackgroundTime; 30 | @property (atomic, readonly) NSTimer *preventSuspendTimer; 31 | 32 | @property (strong, atomic, readonly) CLLocationManager* locationManager; 33 | @property (atomic, readonly) UIBackgroundTaskIdentifier preventSuspendTask; 34 | @property (strong, atomic, readonly) CLLocation* lastLocation; 35 | @property (strong, atomic, readonly) CLLocation* bestLocation; 36 | @property (atomic) NSInteger maxLocationAttempts; 37 | @property (atomic) CLLocationDistance distanceFilter; 38 | @property (atomic) CLLocationAccuracy desiredAccuracy; 39 | @property (atomic) CLActivityType activityType; 40 | @property (readonly) BOOL isUpdating; 41 | @property (readonly) BOOL isWatchingPosition; 42 | 43 | @property (copy) void (^locationChangedBlock) (LocationManager* manager, CLLocation* location, BOOL isSample); 44 | @property (copy) void (^errorBlock) (LocationManager* manager, NSError* error); 45 | 46 | -(void)watchPosition:(TSWatchPositionRequest*)request; 47 | -(void)requestLocation; 48 | -(void)stopWatchPosition; 49 | -(void)startUpdatingLocation; 50 | -(void)startUpdatingLocation:(NSInteger)samples; 51 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout; 52 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout desiredAccuracy:(CLLocationAccuracy)desiredAccuracy; 53 | -(void)stopUpdatingLocation; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/LogQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "SQLQuery.h" 10 | 11 | @interface LogQuery:SQLQuery 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/SQLQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // SQLQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | typedef enum SQLQueryOrder : NSInteger { 10 | tsSQLQueryOrderDESC = -1, 11 | tsSQLQueryOrderASC = 1 12 | } SQLQueryOrder; 13 | 14 | @interface SQLQuery : NSObject 15 | { 16 | @protected 17 | NSString *_tableName; 18 | NSString *_orderColumn; 19 | NSString *_timestampColumn; 20 | } 21 | 22 | @property (nonatomic) double start; 23 | @property (nonatomic) double end; 24 | @property (nonatomic) int limit; 25 | @property (nonatomic) SQLQueryOrder order; 26 | 27 | - (instancetype) initWithDictionary:(NSDictionary*)params; 28 | 29 | - (NSString*) render; 30 | - (NSArray*) arguments; 31 | - (NSString*) toString; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSActivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSActivityChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSActivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger confidence; 12 | @property (nonatomic, readonly) NSString *activity; 13 | 14 | -(id) initWithActivityName:(NSString*)activityName confidence:(NSInteger)confidence; 15 | -(NSDictionary*) toDictionary; 16 | @end 17 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorization.h: -------------------------------------------------------------------------------- 1 | // 2 | // Authorization.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "ConfigModule.h" 10 | #import "TransistorAuthorizationToken.h" 11 | #import "TSAuthorizationEvent.h" 12 | 13 | extern NSString * const TS_AUTHORIZATION_STRATEGY; 14 | extern NSString * const TS_ACCESS_TOKEN; 15 | extern NSString * const TS_REFRESH_TOKEN; 16 | extern NSString * const TS_REFRESH_PAYLOAD; 17 | extern NSString * const TS_EXPIRES; 18 | extern NSString * const TS_REFRESH_URL; 19 | 20 | @interface TSAuthorization:ConfigModule 21 | 22 | @property(nonatomic) NSString* strategy; 23 | @property(nonatomic) NSString* accessToken; 24 | @property(nonatomic) NSString* refreshToken; 25 | @property(nonatomic) NSDictionary* refreshPayload; 26 | @property(nonatomic) NSDictionary* refreshHeaders; 27 | @property(nonatomic) NSString* refreshUrl; 28 | @property(nonatomic) NSTimeInterval expires; 29 | 30 | - (instancetype) initWithDictionary:(NSDictionary*)values; 31 | 32 | - (void) apply:(NSMutableURLRequest*)request; 33 | - (NSString*) toString; 34 | - (void) resolve:(NSInteger)status success:(void(^)(TSAuthorizationEvent*))success failure:(void(^)(TSAuthorizationEvent*))failure; 35 | 36 | @end 37 | 38 | 39 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSAuthorizationEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSAuthorizationEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-26. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | 9 | @interface TSAuthorizationEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger status; 12 | @property (nonatomic, readonly) NSError* error; 13 | @property (nonatomic, readonly) NSDictionary *response; 14 | 15 | -(instancetype) initWithResponse:(NSDictionary*)response status:(NSInteger)status; 16 | -(instancetype) initWithError:(NSError*)error status:(NSInteger)status; 17 | -(NSDictionary*) toDictionary; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCallback.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCallback.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-31. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSCallback : NSObject 10 | 11 | @property (nonatomic, copy) void (^success)(id); 12 | @property (nonatomic, copy) void (^failure)(id); 13 | @property (nonatomic, readonly) NSDictionary *options; 14 | 15 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure; 16 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure options:(NSDictionary*)options; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSConnectivityChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSConnectivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL hasConnection; 12 | 13 | -(instancetype) initWithHasConnection:(BOOL)hasConnection; 14 | -(NSDictionary*) toDictionary; 15 | @end 16 | 17 | 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCurrentPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-11. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSCurrentPositionRequest : NSObject 11 | 12 | @property (atomic) NSTimeInterval timeout; 13 | @property (atomic) double maximumAge; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) int samples; 16 | @property (atomic) CLLocationAccuracy desiredAccuracy; 17 | @property (atomic) NSDictionary* extras; 18 | @property (atomic, copy) void (^success)(TSLocation*); 19 | @property (atomic, copy) void (^failure)(NSError*); 20 | 21 | -(instancetype) init; 22 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 23 | 24 | -(instancetype) initWithPersist:(BOOL)persist 25 | success:(void (^)(TSLocation*))success 26 | failure:(void (^)(NSError*))failure; 27 | 28 | -(instancetype) initWithPersist:(BOOL)persist 29 | samples:(int)samples 30 | success:(void (^)(TSLocation*))success 31 | failure:(void (^)(NSError*))failure; 32 | 33 | -(instancetype) initWithTimeout:(int)timeout 34 | maximumAge:(double)maximumAge 35 | persist:(BOOL)persist 36 | samples:(int)samples 37 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 38 | extras:(NSDictionary*)extras 39 | success:(void (^)(TSLocation*))success 40 | failure:(void (^)(NSError*))failure; 41 | 42 | @end 43 | 44 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSDeviceInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceInfo.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | @interface TSDeviceInfo:NSObject 12 | 13 | + (TSDeviceInfo *)sharedInstance; 14 | 15 | @property(nonatomic) NSString* model; 16 | @property(nonatomic) NSString* manufacturer; 17 | @property(nonatomic) NSString* platform; 18 | @property(nonatomic) NSString* version; 19 | 20 | -(NSDictionary*) toDictionary; 21 | -(NSDictionary*) toDictionary:(NSString*)framework; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSEnabledChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSEnabledChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL enabled; 12 | -(instancetype) initWithEnabled:(BOOL)enabled; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofence.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofence.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-12-21. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface TSGeofence : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSString* identifier; 15 | @property (nonatomic) CLLocationDistance radius; 16 | 17 | @property (nonatomic) CLLocationDegrees latitude; 18 | @property (nonatomic) CLLocationDegrees longitude; 19 | @property (nonatomic) BOOL notifyOnEntry; 20 | @property (nonatomic) BOOL notifyOnExit; 21 | @property (nonatomic) BOOL notifyOnDwell; 22 | @property (nonatomic) double loiteringDelay; 23 | @property (nonatomic) NSDictionary* extras; 24 | @property (nonatomic) NSArray* vertices; 25 | /** 26 | * Arbitrary extra data attached to the geofence 27 | */ 28 | 29 | -(instancetype) initWithIdentifier:(NSString*)identifier 30 | radius:(CLLocationDistance)radius 31 | latitude:(CLLocationDegrees)latitude 32 | longitude:(CLLocationDegrees)lontitude 33 | notifyOnEntry:(BOOL)notifyOnEntry 34 | notifyOnExit:(BOOL)notifyOnExit 35 | notifyOnDwell:(BOOL)notifyOnDwell 36 | loiteringDelay:(double)loiteringDelay; 37 | 38 | -(instancetype) initWithIdentifier:(NSString*)identifier 39 | radius:(CLLocationDistance)radius 40 | latitude:(CLLocationDegrees)latitude 41 | longitude:(CLLocationDegrees)longitude 42 | notifyOnEntry:(BOOL)notifyOnEntry 43 | notifyOnExit:(BOOL)notifyOnExit 44 | notifyOnDwell:(BOOL)notifyOnDwell 45 | loiteringDelay:(double)loiteringDelay 46 | extras:(NSDictionary*)extras 47 | vertices:(NSArray*)vertices; 48 | 49 | - (NSDictionary*) toDictionary; 50 | - (BOOL) isPolygon; 51 | 52 | 53 | @end 54 | 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofenceEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-03-27. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TSLocation.h" 11 | #import "TSGeofence.h" 12 | 13 | /** 14 | The event object provided to `-[TSLocationManager onGeofence:]` 15 | 16 | ```obj-c 17 | TSLocationManager *bgGeo = [TSLocationManager sharedInstance]; 18 | [bgGeo onGeofence:^(TSGeofenceEvent *event) { 19 | NSLog(@"[onGeofence]: %@", event); 20 | }]; 21 | ``` 22 | 23 | */ 24 | @interface TSGeofenceEvent : NSObject 25 | { 26 | 27 | } 28 | 29 | /// The location associated with this geofence event. 30 | @property (nonatomic, readonly) TSLocation* location; 31 | /// The triggered geofence 32 | @property (nonatomic, readonly) TSGeofence* geofence; 33 | /// The region instance. 34 | @property (nonatomic, readonly) CLCircularRegion* region; 35 | 36 | @property (nonatomic) NSDate *timestamp; 37 | 38 | /// The geofence transition (eg: "ENTER", "EXIT", "DWELL" 39 | @property (nonatomic, readonly) NSString* action; 40 | /// :nodoc: 41 | @property (nonatomic, readonly) BOOL isLoitering; 42 | 43 | /// :nodoc: 44 | @property (nonatomic, readonly) BOOL isFinishedLoitering; 45 | 46 | /// :nodoc: 47 | -(instancetype)initWithGeofence:(TSGeofence*)geofence region:(CLCircularRegion*)circularRegion action:(NSString*)actionName; 48 | -(instancetype)initWithGeofence:(TSGeofence*)geofence action:(NSString*)actionName; 49 | 50 | /// :nodoc: 51 | -(void) startLoiteringAt:(CLLocation*)location callback:(void (^)(void))callback; 52 | /// :nodoc: 53 | -(BOOL) isLoiteringAt:(CLLocation*)location; 54 | /// :nodoc: 55 | -(void) setTriggerLocation:(CLLocation*)location; 56 | /// :nodoc: 57 | -(void) cancel; 58 | 59 | /// Returns an `NSDictionary` representaton. 60 | -(NSDictionary*)toDictionary; 61 | 62 | 63 | @end 64 | 65 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofenceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeofenceManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-10-04. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "TSGeofenceEvent.h" 12 | #import "TSGeofencesChangeEvent.h" 13 | 14 | extern NSString *const STATIONARY_REGION_IDENTIFIER; 15 | 16 | @interface TSGeofenceManager : NSObject 17 | { 18 | 19 | } 20 | 21 | @property (copy) void (^onGeofence) (TSGeofenceEvent* event); 22 | 23 | @property (atomic) BOOL isMoving; 24 | @property (atomic) BOOL enabled; 25 | @property (atomic) BOOL evaluated; 26 | @property (atomic) BOOL isUpdatingLocation; 27 | @property (atomic) BOOL isEvaluatingEvents; 28 | @property (atomic) BOOL isRequestingLocation; 29 | @property (atomic) BOOL isMonitoringSignificantChanges; 30 | @property (atomic) BOOL willEvaluateProximity; 31 | @property (atomic) CLLocation *lastLocation; 32 | 33 | @property (atomic, readonly) NSMutableArray *geofencesChangeListeners; 34 | @property (atomic, readonly) NSMutableArray *geofenceListeners; 35 | 36 | 37 | // Event listeners 38 | -(void) onGeofencesChange:(void (^)(TSGeofencesChangeEvent*))success; 39 | -(void) onGeofence:(void (^)(TSGeofenceEvent*))success; 40 | -(void) un:(NSString*)event callback:(void(^)(id))callback; 41 | -(void) removeListeners; 42 | -(void) start; 43 | -(void) stop; 44 | -(void) ready; 45 | -(void) setLocation:(CLLocation*)location isMoving:(BOOL)isMoving; 46 | -(void) setProximityRadius:(CLLocationDistance)radius; 47 | -(BOOL) isMonitoringRegion:(CLCircularRegion*)region; 48 | -(void) didBecomeStationary:(CLLocation*)locaiton; 49 | -(NSString*) identifierFor:(CLCircularRegion*)region; 50 | -(void) create:(NSArray*)geofences success:(void (^)(void))success failure:(void (^)(NSString*))failure; 51 | -(void) destroy:(NSArray*)identifiers success:(void (^)(void))success failure:(void (^)(NSString*))failure; 52 | -(BOOL) isInfiniteMonitoring; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofencesChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSGeofencesChangeEvent : NSObject 11 | 12 | @property (nonatomic, readonly) NSArray* on; 13 | @property (nonatomic, readonly) NSArray* off; 14 | 15 | -(id) initWithOn:(NSArray*)on off:(NSArray*)off; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHeartbeatEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHeartbeat.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "TSLocation.h" 10 | 11 | @interface TSHeartbeatEvent : NSObject 12 | 13 | @property (nonatomic, readonly) TSLocation* location; 14 | 15 | -(id) initWithLocation:(CLLocation*)location; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSHttpEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isSuccess; 12 | @property (nonatomic, readonly) NSInteger statusCode; 13 | @property (nonatomic, readonly) NSDictionary *requestData; 14 | @property (nonatomic, readonly) NSString *responseText; 15 | @property (nonatomic, readonly) NSError *error; 16 | 17 | -(id) initWithStatusCode:(NSInteger)statusCode requestData:(NSDictionary*)requestData responseData:(NSData*)responseData error:(NSError*)error; 18 | -(NSDictionary*) toDictionary; 19 | @end 20 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSHttpService.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduler.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-04-26. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | // 9 | // TSScheduler 10 | // TODO This should be decoupled into some sort of plugin 11 | // 12 | #import 13 | #import 14 | #import "TSConnectivityChangeEvent.h" 15 | #import "TSAuthorizationEvent.h" 16 | #import "AtomicBoolean.h" 17 | #import "HttpRequest.h" 18 | #import "TSReachability.h" 19 | #import "TSCallback.h" 20 | 21 | @class TSHttpService; 22 | 23 | @interface TSHttpService : NSObject 24 | 25 | #pragma mark - Singleton 26 | + (TSHttpService *)sharedInstance; 27 | 28 | #pragma mark - Properties 29 | 30 | @property (copy) void (^httpResponseBlock) (HttpRequest *request, HttpResponse *response); 31 | 32 | @property (nonatomic) AtomicBoolean *isBusy; 33 | @property (nonatomic) BOOL hasNetworkConnection; 34 | 35 | @property (nonatomic, readonly) NSMutableArray *syncedRecords; 36 | @property (nonatomic, readonly) TSReachability *reachability; 37 | @property (nonatomic, readonly) UIBackgroundTaskIdentifier bgTask; 38 | 39 | @property (nonatomic, readonly) NSMutableSet *connectivityChangeListeners; 40 | @property (nonatomic, readonly) NSMutableSet *authorizationListeners; 41 | 42 | @property (nonatomic) TSCallback *callback; 43 | @property (nonatomic) long autoSyncThreshold; 44 | 45 | #pragma mark - Methods 46 | -(void)flush; 47 | -(void)flush:(BOOL)overrideSyncThreshold; 48 | -(void)flush:(void(^)(NSArray*))success failure:(void(^)(NSError*))failure; 49 | -(void)startMonitoring; 50 | -(void)stopMonitoring; 51 | 52 | -(void)onConnectivityChange:(void (^)(TSConnectivityChangeEvent*))success; 53 | -(void)onAuthorization:(void(^)(TSAuthorizationEvent*))callback; 54 | -(void)un:(NSString*)event callback:(void(^)(id))callback; 55 | -(void)removeListeners; 56 | -(void)removeListeners:(NSString*)event; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSLocation.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSLocation.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-02-11. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSLocation : NSObject 10 | 11 | // Location types 12 | typedef enum tsLocationType : NSInteger { 13 | TS_LOCATION_TYPE_MOTIONCHANGE = 0, 14 | TS_LOCATION_TYPE_TRACKING = 1, 15 | TS_LOCATION_TYPE_CURRENT = 2, 16 | TS_LOCATION_TYPE_SAMPLE = 3, 17 | TS_LOCATION_TYPE_WATCH = 4, 18 | TS_LOCATION_TYPE_GEOFENCE = 5, 19 | TS_LOCATION_TYPE_HEARTBEAT = 6 20 | } tsLocationtype; 21 | 22 | /** 23 | * The native CLLocation instance 24 | */ 25 | @property (nonatomic, readonly) CLLocation* location; 26 | /** 27 | * Universally unique identifier. The uuid is used to locate the record in the database. It is also posted by default in HTTP requests so your server can determine if a duplicate location has been posted. It's also helpful to match a location received at your server to entries in the plugin logs. 28 | */ 29 | @property (nonatomic, readonly) NSString *uuid; 30 | /** 31 | * The rendered timestamp in ISO-8851 UTC format (YYYY-MM-dd HH:mm:sssZ) 32 | */ 33 | @property (nonatomic, readonly) NSString *timestamp; 34 | 35 | @property (nonatomic, readonly) NSNumber *age; 36 | /** 37 | * The type of location: MOTIONCHANGE|TRACKING|CURRENT|SAMPLE|WATCH|GEOFENCE|HEARTBEAT 38 | */ 39 | @property (nonatomic, readonly) enum tsLocationType type; 40 | /** 41 | * YES when location was recorded while device is in motion; NO otherwise. 42 | */ 43 | @property (nonatomic, readonly) BOOL isMoving; 44 | /** 45 | * Arbitrary extras data attached to the location. 46 | */ 47 | @property (nonatomic, readonly) NSDictionary* extras; 48 | /** 49 | * For internal use only. Geofence data rendered to NSDictionary for posting to server. 50 | */ 51 | @property (nonatomic, readonly) NSDictionary* geofence; 52 | // Battery 53 | /** 54 | * YES when device is plugged into power and charging 55 | */ 56 | @property (nonatomic, readonly) BOOL batteryIsCharging; 57 | /** 58 | * The battery level between 0 (empty) and 1 (full) 59 | */ 60 | @property (nonatomic, readonly) NSNumber *batteryLevel; 61 | // Activity 62 | /** 63 | * Activity type rendered as string: still|on_foot|in_vehicle|running|on_bicycle 64 | */ 65 | @property (nonatomic, readonly) NSString *activityType; 66 | /** 67 | * Confidence of activity-type estimation as % 0-100 68 | */ 69 | @property (nonatomic, readonly) NSNumber *activityConfidence; 70 | // State 71 | /** 72 | * YES when recorded location is a sample. The plugin records multiple locations for particular events, such as "motionchange" in order to determine 73 | * highest accuracy location before persisting that location to the database and POSTing to your configured #url. Location "samples" are not persisted 74 | * to the plugin's database, nor are they posted to your configured #url 75 | */ 76 | @property (nonatomic, readonly) BOOL isSample; 77 | 78 | @property (nonatomic, readonly) BOOL mock; 79 | /** 80 | * YES when this location was provided to a heartbeat event 81 | */ 82 | @property (nonatomic, readonly) BOOL isHeartbeat; 83 | /** 84 | * The current value of the odometer in meters 85 | */ 86 | @property (nonatomic, readonly) NSNumber *odometer; 87 | /** 88 | * The event associated with this location: location|motionchange|heartbeat|providerchange 89 | */ 90 | @property (nonatomic, readonly) NSString *event; 91 | 92 | -(instancetype) initWithLocation:(CLLocation*)location; 93 | -(instancetype) initWithLocation:(CLLocation*)location type:(enum tsLocationType)type extras:(NSDictionary*)extras; 94 | -(instancetype) initWithLocation:(CLLocation*)location geofence:(NSDictionary*)geofenceData; 95 | 96 | /** 97 | * Render location-data as JSON string 98 | */ 99 | - (NSData*)toJson:(NSError**)error; 100 | /** 101 | * Render location-data as NSDictionary 102 | */ 103 | - (NSDictionary*)toDictionary; 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSPowerSaveChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-09-18. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSPowerSaveChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isPowerSaveMode; 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSProviderChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSProviderChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSProviderChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) CLAuthorizationStatus status; 12 | @property (nonatomic, readonly) NSInteger accuracyAuthorization; 13 | @property (nonatomic, readonly) BOOL gps; 14 | @property (nonatomic, readonly) BOOL network; 15 | @property (nonatomic, readonly) BOOL enabled; 16 | @property (nonatomic, readonly) CLLocationManager* manager; 17 | 18 | -(id) initWithManager:(CLLocationManager*)manager status:(CLAuthorizationStatus)status authorizationRequest:(NSString*)authorizationRequest; 19 | -(NSDictionary*) toDictionary; 20 | @end 21 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSSchedule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSSchedule.h 3 | // BG Geo 4 | // 5 | // Created by Christopher Scott on 2016-04-25. 6 | // 7 | // 8 | #import "TSConfig.h" 9 | 10 | @interface TSSchedule : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSDateComponents* onTime; 15 | @property (nonatomic) NSDate* onDate; 16 | 17 | @property (nonatomic) NSDateComponents* offTime; 18 | @property (nonatomic) NSDate* offDate; 19 | @property (nonatomic) BOOL triggered; 20 | @property (nonatomic) TSTrackingMode trackingMode; 21 | 22 | @property (copy) void (^handlerBlock) (TSSchedule *schedule); 23 | 24 | -(instancetype)initWithRecord:(NSString*)data andHandler:(void (^)(TSSchedule*))handler; 25 | 26 | -(void)make:(NSDateComponents*)NSDateComponents; 27 | -(BOOL)isNext:(NSDate*)now; 28 | -(BOOL)isLiteralDate; 29 | -(BOOL)hasDay:(NSInteger)day; 30 | -(BOOL)startsBefore:(NSDate*)now; 31 | -(BOOL)startsAfter:(NSDate*)now; 32 | -(BOOL)endsBefore:(NSDate*)now; 33 | -(BOOL)endsAfter:(NSDate*)now; 34 | -(BOOL)expired; 35 | -(void)trigger:(BOOL)enabled; 36 | -(void)reset; 37 | -(void)evaluate; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSScheduleEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduleEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSScheduleEvent : NSObject 11 | 12 | @property (nonatomic, readonly) TSSchedule* schedule; 13 | @property (nonatomic, readonly) NSDictionary* state; 14 | 15 | -(id) initWithSchedule:(TSSchedule*)schedule state:(NSDictionary*)state; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TSWatchPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSWatchPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-12. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSWatchPositionRequest : NSObject 11 | 12 | @property (nonatomic) double interval; 13 | @property (atomic) CLLocationAccuracy desiredAccuracy; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) NSDictionary* extras; 16 | @property (atomic) double timeout; 17 | @property (atomic, copy) void (^success)(TSLocation*); 18 | @property (atomic, copy) void (^failure)(NSError*); 19 | 20 | -(instancetype) init; 21 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 22 | 23 | -(instancetype) initWithInterval:(double)interval 24 | success:(void (^)(TSLocation*))success 25 | failure:(void (^)(NSError*))failure; 26 | 27 | -(instancetype) initWithInterval:(double)interval 28 | persist:(BOOL)persist 29 | success:(void (^)(TSLocation*))success 30 | failure:(void (^)(NSError*))failure; 31 | 32 | -(instancetype) initWithInterval:(double)interval 33 | persist:(BOOL)persist 34 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 35 | extras:(NSDictionary*)extras 36 | timeout:(double)timeout 37 | success:(void (^)(TSLocation*))success 38 | failure:(void (^)(NSError*))failure; 39 | 40 | @end 41 | 42 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransistorAuthorizationToken.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /** 11 | * TransistorAuthorizationToken for demo server tracker.transistorsoft.com 12 | */ 13 | @interface TransistorAuthorizationToken:NSObject 14 | 15 | @property (nonatomic) NSString* accessToken; 16 | @property (nonatomic) NSString* refreshToken; 17 | @property (nonatomic) long expires; 18 | 19 | + (void) findOrCreateWithOrg:(NSString*)orgname username:(NSString*)username url:(NSString*)apiUrl framework:(NSString*)framework success:(void(^)(TransistorAuthorizationToken*))success failure:(void(^)(NSError*))error; 20 | + (void) destroyWithUrl:(NSString*)url; 21 | + (BOOL) hasTokenForHost:(NSString*)host; 22 | 23 | - (instancetype) initWithAccessToken:(NSString*)accessToken refreshToken:(NSString*)refreshToken expires:(long)expires; 24 | - (instancetype) initWithDictionary:(NSDictionary*)data; 25 | 26 | -(NSDictionary*) toDictionary; 27 | 28 | @end 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TSLocationManager { 2 | umbrella header "TSLocationManager.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 24A348 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | TSLocationManager 11 | CFBundleIdentifier 12 | com.transistorsoft.TSLocationManager 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | TSLocationManager 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 4.1.6 21 | CFBundleSupportedPlatforms 22 | 23 | MacOSX 24 | 25 | CFBundleVersion 26 | 388 27 | DTCompiler 28 | com.apple.compilers.llvm.clang.1_0 29 | DTPlatformBuild 30 | 24C94 31 | DTPlatformName 32 | macosx 33 | DTPlatformVersion 34 | 15.2 35 | DTSDKBuild 36 | 24C94 37 | DTSDKName 38 | macosx15.2 39 | DTXcode 40 | 1620 41 | DTXcodeBuild 42 | 16C5032a 43 | LSMinimumSystemVersion 44 | 10.15 45 | UIDeviceFamily 46 | 47 | 2 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | NSPrivacyTrackingDomains 13 | 14 | 15 | NSPrivacyAccessedAPITypes 16 | 17 | 18 | NSPrivacyAccessedAPIType 19 | NSPrivacyAccessedAPICategoryUserDefaults 20 | 21 | NSPrivacyAccessedAPITypeReasons 22 | 23 | CA92.1 24 | 1C8F.1 25 | 26 | 27 | 28 | 29 | NSPrivacyCollectedDataTypes 30 | 31 | 32 | NSPrivacyTracking 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/TSLocationManager -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-maccatalyst/TSLocationManager.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/AtomicBoolean.h: -------------------------------------------------------------------------------- 1 | // 2 | // AtomicBoolean.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-11-14. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /// :nodoc: 12 | @interface AtomicBoolean : NSObject 13 | - (instancetype)initWithValue:(BOOL)value; 14 | - (BOOL)getValue; 15 | - (void)setValue:(BOOL)value; 16 | - (BOOL)compareTo:(BOOL)expected andSetValue:(BOOL)value; 17 | - (BOOL)getAndSetValue:(BOOL)value; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/ConfigModule.h: -------------------------------------------------------------------------------- 1 | // 2 | // ConfigModule.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /// :nodoc: 11 | @interface ConfigModule:NSObject 12 | 13 | //-(NSDictionary*) toDictionary; 14 | +(instancetype) createWithDictionary:(NSDictionary*)values; 15 | 16 | -(NSDictionary*) toDictionary; 17 | -(NSDictionary*) toDictionary:(BOOL)redact; 18 | -(BOOL) isEqual; 19 | - (id) valueFromDictionary:(NSDictionary*)values forKey:(NSString*)key forObject:(id)object defaultValue:(id)defaultValue; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/HttpRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "HttpResponse.h" 10 | 11 | @interface HttpRequest : NSObject 12 | 13 | @property(nonatomic) id requestData; 14 | @property(nonatomic) NSURL *url; 15 | 16 | +(void) execute:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 17 | 18 | -(instancetype) initWithRecords:(NSArray*)records callback:(void(^)(HttpRequest*, HttpResponse*))callback; 19 | 20 | @end 21 | 22 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/HttpResponse.h: -------------------------------------------------------------------------------- 1 | // 2 | // HttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-31. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | // Location types 11 | typedef enum TSHttpServiceError : NSInteger { 12 | TSHttpServiveErrorInvalidUrl = 1, 13 | TSHttpServiceErrorNetworkConnection = 2, 14 | TSHttpServiceErrorSyncInProgress = 3, 15 | TSHttpServiceErrorResponse = 4, 16 | TSHttpServiceRedirectError = 5 17 | } TSHttpServiceError; 18 | 19 | @interface HttpResponse : NSObject 20 | 21 | -(instancetype) initWithData:(NSData*)data response:(NSURLResponse*)response error:(NSError*)error; 22 | 23 | @property(nonatomic) NSError* error; 24 | @property(nonatomic) NSData *data; 25 | @property(nonatomic) NSHTTPURLResponse *response; 26 | @property(nonatomic) NSInteger status; 27 | 28 | @end 29 | 30 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/LocationManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // CurrentPositionManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2015-12-07. 6 | // Copyright © 2015 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import "TSWatchPositionRequest.h" 13 | #import "TSCurrentPositionRequest.h" 14 | 15 | /// :nodoc: 16 | @interface LocationManager : NSObject 17 | 18 | // Error codes 19 | typedef enum tsLocationError : NSInteger { 20 | TS_LOCATION_ERROR_ACCEPTABLE_ACCURACY = 100, 21 | TS_LOCATION_ERROR_TIMEOUT = 408 22 | } tsLocationError; 23 | 24 | @property (readonly) NSInteger currentAttempts; 25 | @property (atomic) NSTimer *timeoutTimer; 26 | @property (atomic) NSTimer *watchPositionTimer; 27 | @property (atomic, readonly) NSTimeInterval locationTimeout; 28 | 29 | @property (atomic, readonly) BOOL isAcquiringBackgroundTime; 30 | @property (atomic, readonly) NSTimer *preventSuspendTimer; 31 | 32 | @property (strong, atomic, readonly) CLLocationManager* locationManager; 33 | @property (atomic, readonly) UIBackgroundTaskIdentifier preventSuspendTask; 34 | @property (strong, atomic, readonly) CLLocation* lastLocation; 35 | @property (strong, atomic, readonly) CLLocation* bestLocation; 36 | @property (atomic) NSInteger maxLocationAttempts; 37 | @property (atomic) CLLocationDistance distanceFilter; 38 | @property (atomic) CLLocationAccuracy desiredAccuracy; 39 | @property (atomic) CLActivityType activityType; 40 | @property (readonly) BOOL isUpdating; 41 | @property (readonly) BOOL isWatchingPosition; 42 | 43 | @property (copy) void (^locationChangedBlock) (LocationManager* manager, CLLocation* location, BOOL isSample); 44 | @property (copy) void (^errorBlock) (LocationManager* manager, NSError* error); 45 | 46 | -(void)watchPosition:(TSWatchPositionRequest*)request; 47 | -(void)requestLocation; 48 | -(void)stopWatchPosition; 49 | -(void)startUpdatingLocation; 50 | -(void)startUpdatingLocation:(NSInteger)samples; 51 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout; 52 | -(void)startUpdatingLocation:(NSInteger)samples timeout:(NSTimeInterval)timeout desiredAccuracy:(CLLocationAccuracy)desiredAccuracy; 53 | -(void)stopUpdatingLocation; 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/LogQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // LogQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "SQLQuery.h" 10 | 11 | @interface LogQuery:SQLQuery 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/SQLQuery.h: -------------------------------------------------------------------------------- 1 | // 2 | // SQLQuery.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-10-22. 6 | // Copyright © 2019 Transistor Software. All rights reserved. 7 | // 8 | 9 | typedef enum SQLQueryOrder : NSInteger { 10 | tsSQLQueryOrderDESC = -1, 11 | tsSQLQueryOrderASC = 1 12 | } SQLQueryOrder; 13 | 14 | @interface SQLQuery : NSObject 15 | { 16 | @protected 17 | NSString *_tableName; 18 | NSString *_orderColumn; 19 | NSString *_timestampColumn; 20 | } 21 | 22 | @property (nonatomic) double start; 23 | @property (nonatomic) double end; 24 | @property (nonatomic) int limit; 25 | @property (nonatomic) SQLQueryOrder order; 26 | 27 | - (instancetype) initWithDictionary:(NSDictionary*)params; 28 | 29 | - (NSString*) render; 30 | - (NSArray*) arguments; 31 | - (NSString*) toString; 32 | 33 | @end 34 | 35 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSActivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSActivityChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSActivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger confidence; 12 | @property (nonatomic, readonly) NSString *activity; 13 | 14 | -(id) initWithActivityName:(NSString*)activityName confidence:(NSInteger)confidence; 15 | -(NSDictionary*) toDictionary; 16 | @end 17 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorization.h: -------------------------------------------------------------------------------- 1 | // 2 | // Authorization.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import "ConfigModule.h" 10 | #import "TransistorAuthorizationToken.h" 11 | #import "TSAuthorizationEvent.h" 12 | 13 | extern NSString * const TS_AUTHORIZATION_STRATEGY; 14 | extern NSString * const TS_ACCESS_TOKEN; 15 | extern NSString * const TS_REFRESH_TOKEN; 16 | extern NSString * const TS_REFRESH_PAYLOAD; 17 | extern NSString * const TS_EXPIRES; 18 | extern NSString * const TS_REFRESH_URL; 19 | 20 | @interface TSAuthorization:ConfigModule 21 | 22 | @property(nonatomic) NSString* strategy; 23 | @property(nonatomic) NSString* accessToken; 24 | @property(nonatomic) NSString* refreshToken; 25 | @property(nonatomic) NSDictionary* refreshPayload; 26 | @property(nonatomic) NSDictionary* refreshHeaders; 27 | @property(nonatomic) NSString* refreshUrl; 28 | @property(nonatomic) NSTimeInterval expires; 29 | 30 | - (instancetype) initWithDictionary:(NSDictionary*)values; 31 | 32 | - (void) apply:(NSMutableURLRequest*)request; 33 | - (NSString*) toString; 34 | - (void) resolve:(NSInteger)status success:(void(^)(TSAuthorizationEvent*))success failure:(void(^)(TSAuthorizationEvent*))failure; 35 | 36 | @end 37 | 38 | 39 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSAuthorizationEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSAuthorizationEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-26. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | 9 | @interface TSAuthorizationEvent : NSObject 10 | 11 | @property (nonatomic, readonly) NSInteger status; 12 | @property (nonatomic, readonly) NSError* error; 13 | @property (nonatomic, readonly) NSDictionary *response; 14 | 15 | -(instancetype) initWithResponse:(NSDictionary*)response status:(NSInteger)status; 16 | -(instancetype) initWithError:(NSError*)error status:(NSInteger)status; 17 | -(NSDictionary*) toDictionary; 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSCallback.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCallback.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-31. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSCallback : NSObject 10 | 11 | @property (nonatomic, copy) void (^success)(id); 12 | @property (nonatomic, copy) void (^failure)(id); 13 | @property (nonatomic, readonly) NSDictionary *options; 14 | 15 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure; 16 | -(id) initWithSuccess:(void(^)(id))success failure:(void(^)(id))failure options:(NSDictionary*)options; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSConnectivityChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSConnectivityChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSConnectivityChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL hasConnection; 12 | 13 | -(instancetype) initWithHasConnection:(BOOL)hasConnection; 14 | -(NSDictionary*) toDictionary; 15 | @end 16 | 17 | 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSCurrentPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSCurrentPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-11. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSCurrentPositionRequest : NSObject 11 | 12 | @property (atomic) NSTimeInterval timeout; 13 | @property (atomic) double maximumAge; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) int samples; 16 | @property (atomic) CLLocationAccuracy desiredAccuracy; 17 | @property (atomic) NSDictionary* extras; 18 | @property (atomic, copy) void (^success)(TSLocation*); 19 | @property (atomic, copy) void (^failure)(NSError*); 20 | 21 | -(instancetype) init; 22 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 23 | 24 | -(instancetype) initWithPersist:(BOOL)persist 25 | success:(void (^)(TSLocation*))success 26 | failure:(void (^)(NSError*))failure; 27 | 28 | -(instancetype) initWithPersist:(BOOL)persist 29 | samples:(int)samples 30 | success:(void (^)(TSLocation*))success 31 | failure:(void (^)(NSError*))failure; 32 | 33 | -(instancetype) initWithTimeout:(int)timeout 34 | maximumAge:(double)maximumAge 35 | persist:(BOOL)persist 36 | samples:(int)samples 37 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 38 | extras:(NSDictionary*)extras 39 | success:(void (^)(TSLocation*))success 40 | failure:(void (^)(NSError*))failure; 41 | 42 | @end 43 | 44 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSDeviceInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // DeviceInfo.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | #import 10 | 11 | @interface TSDeviceInfo:NSObject 12 | 13 | + (TSDeviceInfo *)sharedInstance; 14 | 15 | @property(nonatomic) NSString* model; 16 | @property(nonatomic) NSString* manufacturer; 17 | @property(nonatomic) NSString* platform; 18 | @property(nonatomic) NSString* version; 19 | 20 | -(NSDictionary*) toDictionary; 21 | -(NSDictionary*) toDictionary:(NSString*)framework; 22 | 23 | @end 24 | 25 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSEnabledChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSEnabledChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-22. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSEnabledChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL enabled; 12 | -(instancetype) initWithEnabled:(BOOL)enabled; 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofence.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofence.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-12-21. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | #import 9 | 10 | @interface TSGeofence : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSString* identifier; 15 | @property (nonatomic) CLLocationDistance radius; 16 | 17 | @property (nonatomic) CLLocationDegrees latitude; 18 | @property (nonatomic) CLLocationDegrees longitude; 19 | @property (nonatomic) BOOL notifyOnEntry; 20 | @property (nonatomic) BOOL notifyOnExit; 21 | @property (nonatomic) BOOL notifyOnDwell; 22 | @property (nonatomic) double loiteringDelay; 23 | @property (nonatomic) NSDictionary* extras; 24 | @property (nonatomic) NSArray* vertices; 25 | /** 26 | * Arbitrary extra data attached to the geofence 27 | */ 28 | 29 | -(instancetype) initWithIdentifier:(NSString*)identifier 30 | radius:(CLLocationDistance)radius 31 | latitude:(CLLocationDegrees)latitude 32 | longitude:(CLLocationDegrees)lontitude 33 | notifyOnEntry:(BOOL)notifyOnEntry 34 | notifyOnExit:(BOOL)notifyOnExit 35 | notifyOnDwell:(BOOL)notifyOnDwell 36 | loiteringDelay:(double)loiteringDelay; 37 | 38 | -(instancetype) initWithIdentifier:(NSString*)identifier 39 | radius:(CLLocationDistance)radius 40 | latitude:(CLLocationDegrees)latitude 41 | longitude:(CLLocationDegrees)longitude 42 | notifyOnEntry:(BOOL)notifyOnEntry 43 | notifyOnExit:(BOOL)notifyOnExit 44 | notifyOnDwell:(BOOL)notifyOnDwell 45 | loiteringDelay:(double)loiteringDelay 46 | extras:(NSDictionary*)extras 47 | vertices:(NSArray*)vertices; 48 | 49 | - (NSDictionary*) toDictionary; 50 | - (BOOL) isPolygon; 51 | 52 | 53 | @end 54 | 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofenceEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-03-27. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TSLocation.h" 11 | #import "TSGeofence.h" 12 | 13 | /** 14 | The event object provided to `-[TSLocationManager onGeofence:]` 15 | 16 | ```obj-c 17 | TSLocationManager *bgGeo = [TSLocationManager sharedInstance]; 18 | [bgGeo onGeofence:^(TSGeofenceEvent *event) { 19 | NSLog(@"[onGeofence]: %@", event); 20 | }]; 21 | ``` 22 | 23 | */ 24 | @interface TSGeofenceEvent : NSObject 25 | { 26 | 27 | } 28 | 29 | /// The location associated with this geofence event. 30 | @property (nonatomic, readonly) TSLocation* location; 31 | /// The triggered geofence 32 | @property (nonatomic, readonly) TSGeofence* geofence; 33 | /// The region instance. 34 | @property (nonatomic, readonly) CLCircularRegion* region; 35 | 36 | @property (nonatomic) NSDate *timestamp; 37 | 38 | /// The geofence transition (eg: "ENTER", "EXIT", "DWELL" 39 | @property (nonatomic, readonly) NSString* action; 40 | /// :nodoc: 41 | @property (nonatomic, readonly) BOOL isLoitering; 42 | 43 | /// :nodoc: 44 | @property (nonatomic, readonly) BOOL isFinishedLoitering; 45 | 46 | /// :nodoc: 47 | -(instancetype)initWithGeofence:(TSGeofence*)geofence region:(CLCircularRegion*)circularRegion action:(NSString*)actionName; 48 | -(instancetype)initWithGeofence:(TSGeofence*)geofence action:(NSString*)actionName; 49 | 50 | /// :nodoc: 51 | -(void) startLoiteringAt:(CLLocation*)location callback:(void (^)(void))callback; 52 | /// :nodoc: 53 | -(BOOL) isLoiteringAt:(CLLocation*)location; 54 | /// :nodoc: 55 | -(void) setTriggerLocation:(CLLocation*)location; 56 | /// :nodoc: 57 | -(void) cancel; 58 | 59 | /// Returns an `NSDictionary` representaton. 60 | -(NSDictionary*)toDictionary; 61 | 62 | 63 | @end 64 | 65 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofenceManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeofenceManager.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-10-04. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "TSGeofenceEvent.h" 12 | #import "TSGeofencesChangeEvent.h" 13 | 14 | extern NSString *const STATIONARY_REGION_IDENTIFIER; 15 | 16 | @interface TSGeofenceManager : NSObject 17 | { 18 | 19 | } 20 | 21 | @property (copy) void (^onGeofence) (TSGeofenceEvent* event); 22 | 23 | @property (atomic) BOOL isMoving; 24 | @property (atomic) BOOL enabled; 25 | @property (atomic) BOOL evaluated; 26 | @property (atomic) BOOL isUpdatingLocation; 27 | @property (atomic) BOOL isEvaluatingEvents; 28 | @property (atomic) BOOL isRequestingLocation; 29 | @property (atomic) BOOL isMonitoringSignificantChanges; 30 | @property (atomic) BOOL willEvaluateProximity; 31 | @property (atomic) CLLocation *lastLocation; 32 | 33 | @property (atomic, readonly) NSMutableArray *geofencesChangeListeners; 34 | @property (atomic, readonly) NSMutableArray *geofenceListeners; 35 | 36 | 37 | // Event listeners 38 | -(void) onGeofencesChange:(void (^)(TSGeofencesChangeEvent*))success; 39 | -(void) onGeofence:(void (^)(TSGeofenceEvent*))success; 40 | -(void) un:(NSString*)event callback:(void(^)(id))callback; 41 | -(void) removeListeners; 42 | -(void) start; 43 | -(void) stop; 44 | -(void) ready; 45 | -(void) setLocation:(CLLocation*)location isMoving:(BOOL)isMoving; 46 | -(void) setProximityRadius:(CLLocationDistance)radius; 47 | -(BOOL) isMonitoringRegion:(CLCircularRegion*)region; 48 | -(void) didBecomeStationary:(CLLocation*)locaiton; 49 | -(NSString*) identifierFor:(CLCircularRegion*)region; 50 | -(void) create:(NSArray*)geofences success:(void (^)(void))success failure:(void (^)(NSString*))failure; 51 | -(void) destroy:(NSArray*)identifiers success:(void (^)(void))success failure:(void (^)(NSString*))failure; 52 | -(BOOL) isInfiniteMonitoring; 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSGeofencesChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSGeofencesChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSGeofencesChangeEvent : NSObject 11 | 12 | @property (nonatomic, readonly) NSArray* on; 13 | @property (nonatomic, readonly) NSArray* off; 14 | 15 | -(id) initWithOn:(NSArray*)on off:(NSArray*)off; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHeartbeatEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHeartbeat.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | #import "TSLocation.h" 10 | 11 | @interface TSHeartbeatEvent : NSObject 12 | 13 | @property (nonatomic, readonly) TSLocation* location; 14 | 15 | -(id) initWithLocation:(CLLocation*)location; 16 | -(NSDictionary*) toDictionary; 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSHttpResponse.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSHttpEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isSuccess; 12 | @property (nonatomic, readonly) NSInteger statusCode; 13 | @property (nonatomic, readonly) NSDictionary *requestData; 14 | @property (nonatomic, readonly) NSString *responseText; 15 | @property (nonatomic, readonly) NSError *error; 16 | 17 | -(id) initWithStatusCode:(NSInteger)statusCode requestData:(NSDictionary*)requestData responseData:(NSData*)responseData error:(NSError*)error; 18 | -(NSDictionary*) toDictionary; 19 | @end 20 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSHttpService.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduler.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2016-04-26. 6 | // Copyright © 2016 Transistor Software. All rights reserved. 7 | // 8 | // 9 | // TSScheduler 10 | // TODO This should be decoupled into some sort of plugin 11 | // 12 | #import 13 | #import 14 | #import "TSConnectivityChangeEvent.h" 15 | #import "TSAuthorizationEvent.h" 16 | #import "AtomicBoolean.h" 17 | #import "HttpRequest.h" 18 | #import "TSReachability.h" 19 | #import "TSCallback.h" 20 | 21 | @class TSHttpService; 22 | 23 | @interface TSHttpService : NSObject 24 | 25 | #pragma mark - Singleton 26 | + (TSHttpService *)sharedInstance; 27 | 28 | #pragma mark - Properties 29 | 30 | @property (copy) void (^httpResponseBlock) (HttpRequest *request, HttpResponse *response); 31 | 32 | @property (nonatomic) AtomicBoolean *isBusy; 33 | @property (nonatomic) BOOL hasNetworkConnection; 34 | 35 | @property (nonatomic, readonly) NSMutableArray *syncedRecords; 36 | @property (nonatomic, readonly) TSReachability *reachability; 37 | @property (nonatomic, readonly) UIBackgroundTaskIdentifier bgTask; 38 | 39 | @property (nonatomic, readonly) NSMutableSet *connectivityChangeListeners; 40 | @property (nonatomic, readonly) NSMutableSet *authorizationListeners; 41 | 42 | @property (nonatomic) TSCallback *callback; 43 | @property (nonatomic) long autoSyncThreshold; 44 | 45 | #pragma mark - Methods 46 | -(void)flush; 47 | -(void)flush:(BOOL)overrideSyncThreshold; 48 | -(void)flush:(void(^)(NSArray*))success failure:(void(^)(NSError*))failure; 49 | -(void)startMonitoring; 50 | -(void)stopMonitoring; 51 | 52 | -(void)onConnectivityChange:(void (^)(TSConnectivityChangeEvent*))success; 53 | -(void)onAuthorization:(void(^)(TSAuthorizationEvent*))callback; 54 | -(void)un:(NSString*)event callback:(void(^)(id))callback; 55 | -(void)removeListeners; 56 | -(void)removeListeners:(NSString*)event; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSPowerSaveChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSPowerSaveChangeEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-09-18. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSPowerSaveChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) BOOL isPowerSaveMode; 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSProviderChangeEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSProviderChange.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-28. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | 9 | @interface TSProviderChangeEvent : NSObject 10 | 11 | @property (nonatomic, readonly) CLAuthorizationStatus status; 12 | @property (nonatomic, readonly) NSInteger accuracyAuthorization; 13 | @property (nonatomic, readonly) BOOL gps; 14 | @property (nonatomic, readonly) BOOL network; 15 | @property (nonatomic, readonly) BOOL enabled; 16 | @property (nonatomic, readonly) CLLocationManager* manager; 17 | 18 | -(id) initWithManager:(CLLocationManager*)manager status:(CLAuthorizationStatus)status authorizationRequest:(NSString*)authorizationRequest; 19 | -(NSDictionary*) toDictionary; 20 | @end 21 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSSchedule.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSSchedule.h 3 | // BG Geo 4 | // 5 | // Created by Christopher Scott on 2016-04-25. 6 | // 7 | // 8 | #import "TSConfig.h" 9 | 10 | @interface TSSchedule : NSObject 11 | { 12 | 13 | } 14 | @property (nonatomic) NSDateComponents* onTime; 15 | @property (nonatomic) NSDate* onDate; 16 | 17 | @property (nonatomic) NSDateComponents* offTime; 18 | @property (nonatomic) NSDate* offDate; 19 | @property (nonatomic) BOOL triggered; 20 | @property (nonatomic) TSTrackingMode trackingMode; 21 | 22 | @property (copy) void (^handlerBlock) (TSSchedule *schedule); 23 | 24 | -(instancetype)initWithRecord:(NSString*)data andHandler:(void (^)(TSSchedule*))handler; 25 | 26 | -(void)make:(NSDateComponents*)NSDateComponents; 27 | -(BOOL)isNext:(NSDate*)now; 28 | -(BOOL)isLiteralDate; 29 | -(BOOL)hasDay:(NSInteger)day; 30 | -(BOOL)startsBefore:(NSDate*)now; 31 | -(BOOL)startsAfter:(NSDate*)now; 32 | -(BOOL)endsBefore:(NSDate*)now; 33 | -(BOOL)endsAfter:(NSDate*)now; 34 | -(BOOL)expired; 35 | -(void)trigger:(BOOL)enabled; 36 | -(void)reset; 37 | -(void)evaluate; 38 | 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSScheduleEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSScheduleEvent.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2017-07-29. 6 | // Copyright © 2017 Transistor Software. All rights reserved. 7 | // 8 | #import "TSSchedule.h" 9 | 10 | @interface TSScheduleEvent : NSObject 11 | 12 | @property (nonatomic, readonly) TSSchedule* schedule; 13 | @property (nonatomic, readonly) NSDictionary* state; 14 | 15 | -(id) initWithSchedule:(TSSchedule*)schedule state:(NSDictionary*)state; 16 | 17 | @end 18 | 19 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TSWatchPositionRequest.h: -------------------------------------------------------------------------------- 1 | // 2 | // TSWatchPositionRequest.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2018-02-12. 6 | // Copyright © 2018 Transistor Software. All rights reserved. 7 | // 8 | #import "TSLocation.h" 9 | 10 | @interface TSWatchPositionRequest : NSObject 11 | 12 | @property (nonatomic) double interval; 13 | @property (atomic) CLLocationAccuracy desiredAccuracy; 14 | @property (atomic) BOOL persist; 15 | @property (atomic) NSDictionary* extras; 16 | @property (atomic) double timeout; 17 | @property (atomic, copy) void (^success)(TSLocation*); 18 | @property (atomic, copy) void (^failure)(NSError*); 19 | 20 | -(instancetype) init; 21 | -(instancetype) initWithSuccess:(void (^)(TSLocation*))success failure:(void (^)(NSError*))failure; 22 | 23 | -(instancetype) initWithInterval:(double)interval 24 | success:(void (^)(TSLocation*))success 25 | failure:(void (^)(NSError*))failure; 26 | 27 | -(instancetype) initWithInterval:(double)interval 28 | persist:(BOOL)persist 29 | success:(void (^)(TSLocation*))success 30 | failure:(void (^)(NSError*))failure; 31 | 32 | -(instancetype) initWithInterval:(double)interval 33 | persist:(BOOL)persist 34 | desiredAccuracy:(CLLocationAccuracy)desiredAccuracy 35 | extras:(NSDictionary*)extras 36 | timeout:(double)timeout 37 | success:(void (^)(TSLocation*))success 38 | failure:(void (^)(NSError*))failure; 39 | 40 | @end 41 | 42 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Headers/TransistorAuthorizationToken.h: -------------------------------------------------------------------------------- 1 | // 2 | // TransistorAuthorizationToken.h 3 | // TSLocationManager 4 | // 5 | // Created by Christopher Scott on 2019-11-21. 6 | // Copyright © 2019 Christopher Scott. All rights reserved. 7 | // 8 | #import 9 | 10 | /** 11 | * TransistorAuthorizationToken for demo server tracker.transistorsoft.com 12 | */ 13 | @interface TransistorAuthorizationToken:NSObject 14 | 15 | @property (nonatomic) NSString* accessToken; 16 | @property (nonatomic) NSString* refreshToken; 17 | @property (nonatomic) long expires; 18 | 19 | + (void) findOrCreateWithOrg:(NSString*)orgname username:(NSString*)username url:(NSString*)apiUrl framework:(NSString*)framework success:(void(^)(TransistorAuthorizationToken*))success failure:(void(^)(NSError*))error; 20 | + (void) destroyWithUrl:(NSString*)url; 21 | + (BOOL) hasTokenForHost:(NSString*)host; 22 | 23 | - (instancetype) initWithAccessToken:(NSString*)accessToken refreshToken:(NSString*)refreshToken expires:(long)expires; 24 | - (instancetype) initWithDictionary:(NSDictionary*)data; 25 | 26 | -(NSDictionary*) toDictionary; 27 | 28 | @end 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Info.plist -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module TSLocationManager { 2 | umbrella header "TSLocationManager.h" 3 | export * 4 | 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | NSPrivacyTrackingDomains 13 | 14 | 15 | NSPrivacyAccessedAPITypes 16 | 17 | 18 | NSPrivacyAccessedAPIType 19 | NSPrivacyAccessedAPICategoryUserDefaults 20 | 21 | NSPrivacyAccessedAPITypeReasons 22 | 23 | CA92.1 24 | 1C8F.1 25 | 26 | 27 | 28 | 29 | NSPrivacyCollectedDataTypes 30 | 31 | 32 | NSPrivacyTracking 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/TSLocationManager: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/TSLocationManager -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeDirectory -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeRequirements-1 -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeSignature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/transistorsoft/react-native-background-geolocation/e2535ea0caf0f9babe12f62523aca585d5fd22d8/ios/RNBackgroundGeolocation/TSLocationManager.xcframework/ios-arm64_x86_64-simulator/TSLocationManager.framework/_CodeSignature/CodeSignature -------------------------------------------------------------------------------- /ios/RNBackgroundGeolocationTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | NSPrivacyTrackingDomains 13 | 14 | 15 | NSPrivacyAccessedAPITypes 16 | 17 | 18 | NSPrivacyAccessedAPIType 19 | NSPrivacyAccessedAPICategoryUserDefaults 20 | 21 | NSPrivacyAccessedAPITypeReasons 22 | 23 | CA92.1 24 | 1C8F.1 25 | 26 | 27 | 28 | 29 | NSPrivacyCollectedDataTypes 30 | 31 | 32 | NSPrivacyTracking 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-background-geolocation", 3 | "version": "4.18.7", 4 | "description": "The most sophisticated cross-platform background location-tracking & geofencing module with battery-conscious motion-detection intelligence", 5 | "scripts": { 6 | "build": "yarn run build:expo", 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "build:expo": "rimraf expo/plugin/build && tsc --build ./expo/plugin" 9 | }, 10 | "main": "src/index.js", 11 | "repository": { 12 | "type": "git", 13 | "url": "git+ssh://git@github.com/transistorsoft/react-native-background-geolocation.git" 14 | }, 15 | "keywords": [ 16 | "react-native", 17 | "react-component", 18 | "ios", 19 | "android", 20 | "background", 21 | "geolocation", 22 | "tracking", 23 | "geofence", 24 | "geofencing" 25 | ], 26 | "author": "Chris Scott ", 27 | "license": "MIT", 28 | "bugs": { 29 | "url": "https://github.com/transistorsoft/react-native-background-geolocation/issues" 30 | }, 31 | "homepage": "https://www.transistorsoft.com/shop/products/react-native-background-geolocation", 32 | "dependencies": { 33 | "react-native-background-fetch": "~4.2.6" 34 | }, 35 | "devDependencies": { 36 | "@expo/config-plugins": "^4.1.0", 37 | "@transistorsoft/typedoc-theme": "^2.0.9", 38 | "@types/node": "^18.11.5", 39 | "chalk": "^4.1.0", 40 | "fs-extra": "^9.1.0", 41 | "path": "^0.12.7", 42 | "rimraf": "^3.0.2", 43 | "typescript": "^4.6.2" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /scripts/cp-declarations: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ### 4 | # Copies the Typescript modules from another project (eg: Free->Premium and vice-versa). 5 | # Re-writes each definition file's declare module "module-name" to the current module-name. 6 | # 7 | # Usage: 8 | # $ ./cp-declaration ../xxx-background-geolocation 9 | # 10 | 11 | if [ -z "$1" ] 12 | then 13 | echo "ERROR: No source path provided" 14 | exit 15 | fi 16 | # Strip trailing / 17 | SOURCE_PATH=$(echo $1 | tr -s /) 18 | SOURCE_PATH=${SOURCE_PATH%/} 19 | 20 | # Sample the source directory for path of /declarations 21 | if [ -d "$SOURCE_PATH/src/declarations" ]; then 22 | SOURCE_PATH="$SOURCE_PATH/src/declarations" 23 | elif [ -d "$SOURCE_PATH/src/ionic/declarations" ]; then 24 | SOURCE_PATH="$SOURCE_PATH/src/ionic/declarations" 25 | else 26 | echo "ERROR: Invalid source path" 27 | exit 28 | fi 29 | 30 | # Sample the destination directory for path of /declarations 31 | DESTINATION_PATH="." 32 | if [ -d "$DESTINATION_PATH/src/declarations" ]; then 33 | DESTINATION_PATH="$DESTINATION_PATH/src" 34 | elif [ -d "$DESTINATION_PATH/src/ionic" ]; then 35 | DESTINATION_PATH="$DESTINATION_PATH/src/ionic" 36 | else 37 | echo "ERROR: Invalid destination. Are you in a background-geolocation project?" 38 | exit 39 | fi 40 | 41 | # This module's name 42 | MODULE_NAME="${PWD##*/}" 43 | 44 | cp -R -f "$SOURCE_PATH" "$DESTINATION_PATH" 45 | echo "MODULE $MODULE_NAME" 46 | echo "SOURCE: $SOURCE_PATH" 47 | echo "DESTINATION: $DESTINATION_PATH" 48 | 49 | 50 | # Finally, 'declare module "xxx-background-geolocation"' in every .d.ts file. 51 | find "$DESTINATION_PATH/declarations" -type f -name "*.d.ts" -print0 | xargs -0 sed -i '' -e "s/declare module.*/declare module \"$MODULE_NAME\" \{/g" 52 | 53 | 54 | -------------------------------------------------------------------------------- /scripts/declare-module: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | find ./src/declarations -type f -name "*.d.ts" -print0 | xargs -0 sed -i '' -e 's/declare module.*/declare module "react-native-background-geolocation" \{/g' -------------------------------------------------------------------------------- /scripts/docs-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /scripts/generate-docs: -------------------------------------------------------------------------------- 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 | 24 | -------------------------------------------------------------------------------- /scripts/tsconfig.json: -------------------------------------------------------------------------------- 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 | } -------------------------------------------------------------------------------- /src/DeviceSettings.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { NativeModules } from "react-native" 4 | 5 | const { RNBackgroundGeolocation } = NativeModules; 6 | 7 | const IGNORE_BATTERY_OPTIMIZATIONS = "IGNORE_BATTERY_OPTIMIZATIONS"; 8 | const POWER_MANAGER = "POWER_MANAGER"; 9 | 10 | let resolveSettingsRequest = function(resolve, request) { 11 | if (request.lastSeenAt > 0) { 12 | request.lastSeenAt = new Date(request.lastSeenAt); 13 | } 14 | resolve(request); 15 | } 16 | 17 | export default class DeviceSettings { 18 | isIgnoringBatteryOptimizations() { 19 | return new Promise((resolve, reject) => { 20 | let success = (isIgnoring) => { resolve(isIgnoring) } 21 | let failure = (error) => { reject(error) } 22 | RNBackgroundGeolocation.isIgnoringBatteryOptimizations(success, failure); 23 | }); 24 | } 25 | 26 | showIgnoreBatteryOptimizations() { 27 | return new Promise((resolve, reject) => { 28 | let success = (request) => { resolveSettingsRequest(resolve, request) } 29 | let failure = (error) => { reject(error) } 30 | let args = {action: IGNORE_BATTERY_OPTIMIZATIONS}; 31 | RNBackgroundGeolocation.requestSettings(args, success, failure); 32 | }); 33 | } 34 | 35 | showPowerManager() { 36 | return new Promise((resolve, reject) => { 37 | let success = (request) => { resolveSettingsRequest(resolve, request) } 38 | let failure = (error) => { reject(error) } 39 | let args = {action: POWER_MANAGER}; 40 | RNBackgroundGeolocation.requestSettings(args, success, failure); 41 | }); 42 | } 43 | 44 | show(request) { 45 | return new Promise((resolve, reject) => { 46 | let success = (success) => { resolve(success) } 47 | let failure = (error) => { reject(error) } 48 | let args = {action: request.action}; 49 | RNBackgroundGeolocation.showSettings(args, success, failure); 50 | }); 51 | } 52 | } -------------------------------------------------------------------------------- /src/Events.js: -------------------------------------------------------------------------------- 1 | export const BOOT = "boot"; 2 | export const TERMINATE = "terminate"; 3 | export const LOCATION = "location"; 4 | export const HTTP = "http"; 5 | export const MOTIONCHANGE = "motionchange"; 6 | export const PROVIDERCHANGE = "providerchange"; 7 | export const HEARTBEAT = "heartbeat"; 8 | export const ACTIVITYCHANGE = "activitychange"; 9 | export const GEOFENCE = "geofence"; 10 | export const GEOFENCESCHANGE = "geofenceschange"; 11 | export const SCHEDULE = "schedule"; 12 | export const CONNECTIVITYCHANGE = "connectivitychange"; 13 | export const ENABLEDCHANGE = "enabledchange"; 14 | export const POWERSAVECHANGE = "powersavechange"; 15 | export const NOTIFICATIONACTION = "notificationaction"; 16 | export const AUTHORIZATION = "authorization"; 17 | 18 | -------------------------------------------------------------------------------- /src/Logger.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { NativeModules } from "react-native" 4 | 5 | const { RNBackgroundGeolocation } = NativeModules; 6 | 7 | const LOG_LEVEL_DEBUG = "debug"; 8 | const LOG_LEVEL_NOTICE = "notice"; 9 | const LOG_LEVEL_INFO = "info"; 10 | const LOG_LEVEL_WARN = "warn"; 11 | const LOG_LEVEL_ERROR = "error"; 12 | 13 | const ORDER_ASC = 1; 14 | const ORDER_DESC = -1; 15 | 16 | function log(level, msg) { 17 | RNBackgroundGeolocation.log(level, msg); 18 | } 19 | 20 | function validateQuery(query) { 21 | if (typeof(query) !== 'object') return {}; 22 | 23 | if (query.hasOwnProperty('start') && isNaN(query.start)) { 24 | throw new Error('Invalid SQLQuery.start. Expected unix timestamp but received: ' + query.start); 25 | } 26 | if (query.hasOwnProperty('end') && isNaN(query.end)) { 27 | throw new Error('Invalid SQLQuery.end. Expected unix timestamp but received: ' + query.end); 28 | } 29 | return query; 30 | } 31 | 32 | export default class Logger { 33 | static get ORDER_ASC() { return ORDER_ASC; } 34 | static get ORDER_DESC() { return ORDER_DESC; } 35 | 36 | static debug(msg) { 37 | log(LOG_LEVEL_DEBUG, msg); 38 | } 39 | 40 | static error(msg) { 41 | log(LOG_LEVEL_ERROR, msg); 42 | } 43 | 44 | static warn(msg) { 45 | log(LOG_LEVEL_WARN, msg); 46 | } 47 | 48 | static info(msg) { 49 | log(LOG_LEVEL_INFO, msg); 50 | } 51 | 52 | static notice(msg) { 53 | log(LOG_LEVEL_NOTICE, msg); 54 | } 55 | 56 | static getLog(query) { 57 | query = validateQuery(query); 58 | return new Promise((resolve, reject) => { 59 | let success = (log) => { resolve(log) } 60 | let failure = (error) => { reject(error) } 61 | RNBackgroundGeolocation.getLog(query, success, failure); 62 | }); 63 | } 64 | 65 | static emailLog(email, query) { 66 | query = validateQuery(query); 67 | return new Promise((resolve, reject) => { 68 | let success = (success) => { resolve(success) } 69 | let failure = (error) => { reject(error) } 70 | RNBackgroundGeolocation.emailLog(email, query, success, failure); 71 | }); 72 | } 73 | 74 | static uploadLog(url, query) { 75 | query = validateQuery(query); 76 | return new Promise((resolve, reject) => { 77 | let success = (success) => { resolve(success) } 78 | let failure = (error) => { reject(error) } 79 | RNBackgroundGeolocation.uploadLog(url, query, success, failure); 80 | }); 81 | } 82 | 83 | static destroyLog() { 84 | return new Promise((resolve, reject) => { 85 | let success = (success) => { resolve(success) } 86 | let failure = (error) => { reject(error) } 87 | RNBackgroundGeolocation.destroyLog(success, failure); 88 | }); 89 | } 90 | } -------------------------------------------------------------------------------- /src/TransistorAuthorizationToken.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | import { NativeModules } from "react-native" 4 | 5 | const DEFAULT_URL = 'https://tracker.transistorsoft.com'; 6 | 7 | const DUMMY_TOKEN = 'DUMMY_TOKEN'; 8 | 9 | const REFRESH_PAYLOAD = { 10 | refresh_token: '{refreshToken}' 11 | } 12 | 13 | const LOCATIONS_PATH = '/api/locations'; 14 | 15 | const REFRESH_TOKEN_PATH = '/api/refresh_token'; 16 | 17 | const { RNBackgroundGeolocation } = NativeModules; 18 | 19 | export default class TransistorAuthorizationToken { 20 | static findOrCreate(orgname, username, url=DEFAULT_URL) { 21 | 22 | return new Promise((resolve, reject) => { 23 | let success = (token) => { 24 | // Configure Transistor url and refreshPayload. Flutter is so much nice for this stuff. 25 | token.url = url; 26 | resolve(token) 27 | } 28 | let failure = (error) => { 29 | console.warn('[TransistorAuthorizationToken findOrCreate] ERROR: ', error); 30 | // Return a dummy token on error. this is a weird thing to do but it probably failed due to no network connection to demo server. 31 | // Once app will request the token once again after restarting one's app. 32 | if (error.status == '403') { 33 | reject(error); 34 | return; 35 | } 36 | resolve({ 37 | accessToken: DUMMY_TOKEN, 38 | refreshToken: DUMMY_TOKEN, 39 | expires: -1, 40 | url:url 41 | }); 42 | } 43 | RNBackgroundGeolocation.getTransistorToken(orgname, username, url, success, failure); 44 | }); 45 | } 46 | 47 | static destroy(url=DEFAULT_URL) { 48 | return new Promise((resolve, reject) => { 49 | let success = (token) => { resolve(token) } 50 | let failure = (error) => { reject(error) } 51 | 52 | RNBackgroundGeolocation.destroyTransistorToken(url, success, failure); 53 | }); 54 | } 55 | 56 | static applyIf(config) { 57 | if (!config.transistorAuthorizationToken) return config; 58 | 59 | let token = config.transistorAuthorizationToken; 60 | delete config.transistorAuthorizationToken; 61 | 62 | config.url = token.url + LOCATIONS_PATH; 63 | config.authorization = { 64 | strategy: 'JWT', 65 | accessToken: token.accessToken, 66 | refreshToken: token.refreshToken, 67 | refreshUrl: token.url + REFRESH_TOKEN_PATH, 68 | refreshPayload: REFRESH_PAYLOAD, 69 | expires: token.expires 70 | } 71 | return config; 72 | } 73 | } -------------------------------------------------------------------------------- /src/declarations/interfaces/AuthorizationEvent.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * The event-object provided to [[BackgroundGeolocation.onAuthorization]] 4 | * 5 | * @example 6 | * ```typescript 7 | * BackgroundGeolocation.onAuthorization(authorizationEvent => { 8 | * if (authorizationEvent.success) { 9 | * console.log("[authorization] SUCCESS: ", authorizationEvent.response); 10 | * else { 11 | * console.log("[authorization] FAILURE: ", authorizationEvent.error); 12 | * } 13 | * }); 14 | * ``` 15 | */ 16 | interface AuthorizationEvent { 17 | /** 18 | * HTTP Status returned from your [[Authorization.refreshUrl]] (or `0` if the HTTP request failed). 19 | */ 20 | status:number; 21 | /** 22 | * `true` when an authorization request to [[Authorization.refreshUrl]] was successful. 23 | */ 24 | success: boolean; 25 | /** 26 | * When [[success]] is `false`, this is the error message from [[Authorization.refreshUrl]]. Otherwise, `null`. 27 | */ 28 | error: string; 29 | /** 30 | * when [[success]] is `true`, this is the decoded JSON response returned from [[Authorization.refreshUrl]]. Otherwise, `null`. 31 | */ 32 | response:any; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/declarations/interfaces/ConnectivityChangeEvent.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * The event-object provided to [[BackgroundGeolocation.onConnectivityChange]] 4 | * 5 | * @example 6 | * ```typescript 7 | * BackgroundGeolocation.onConnectivityChange(connectivityChangeEvent => { 8 | * console.log("[connectivitychange] ", connectivityChangeEvent.connected); 9 | * }); 10 | * ``` 11 | */ 12 | interface ConnectivityChangeEvent { 13 | /** 14 | * `true` when the device has access to a network connection. 15 | */ 16 | connected: boolean; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/declarations/interfaces/CurrentPositionRequest.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Options provided to [[getCurrentPosition]]. 4 | * 5 | * @example 6 | * ```typescript 7 | * let location = await BackgroundGeolocation.getCurrentPosition({ 8 | * timeout: 30, // 30 second timeout to fetch location 9 | * persist: true, // Defaults to state.enabled 10 | * maximumAge: 5000, // Accept the last-known-location if not older than 5000 ms. 11 | * desiredAccuracy: 10, // Try to fetch a location with an accuracy of `10` meters. 12 | * samples: 3, // How many location samples to attempt. 13 | * extras: { // Custom meta-data. 14 | * "route_id": 123 15 | * } 16 | * }); 17 | * ``` 18 | */ 19 | interface CurrentPositionRequest { 20 | /** 21 | * Sets the maximum number of location-samples to fetch before returning the best possible location to your `callback`. Default is `3`. Only the final Location will be persisted. 22 | */ 23 | samples?: number; 24 | /** 25 | * Sets the desired accuracy of location you're attempting to fetch. When a location having `accuracy <= desiredAccuracy` is retrieved, the plugin will stop sampling and immediately return that location. Defaults to your configured [[Config.stationaryRadius]]. 26 | */ 27 | desiredAccuracy?: number; 28 | /** 29 | * Location-timeout in `seconds`. Default: `30`. If the timeout expires before a [[Location]] is retrieved, a [[LocationError]] will fire. 30 | */ 31 | timeout?: number; 32 | /** 33 | * Defaults to `true` when plugin is `enabled`; `false`, otherwise. Set `false` to disable persisting the retrieved Location in the plugin's SQLite database. 34 | */ 35 | persist?: boolean; 36 | /** 37 | * Accept the last-recorded-location if no older than supplied value in `milliseconds`. Default is `0`. 38 | */ 39 | maximumAge?: number; 40 | /** 41 | * Optional meta-data to attach to the location. These `extras` will be merged to the configured [[Config.extras]] and persisted / POSTed to your server (if you've configured a [[Config.url]]. 42 | */ 43 | extras?: Extras; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/declarations/interfaces/DeviceInfo.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Simple device information, much simpler than other 3rd party libraries. 4 | * 5 | * @example 6 | * ```typescript 7 | * let deviceInfo = await BackgroundGeolocation.getDeviceInfo(); 8 | * ``` 9 | */ 10 | interface DeviceInfo { 11 | /** 12 | * Device model 13 | */ 14 | model:string; 15 | /** 16 | * Device manufacturer. 17 | */ 18 | manufacturer:string; 19 | /** 20 | * OS Version code. 21 | */ 22 | version:string; 23 | /** 24 | * Platform: iOS or Android 25 | */ 26 | platform:string; 27 | /** 28 | * Development framework (react-native or cordova) 29 | */ 30 | framework:string; 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /src/declarations/interfaces/GeofenceEvent.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * The event-object provided to [[BackgroundGeolocation.onGeofence]] when a geofence transition event occurs. 4 | * 5 | * @example 6 | * ```typescript 7 | * BackgroundGeolocation.onGeofence(geofenceEvent => { 8 | * console.log("[geofence] ", geofenceEvent.identifier, geofence.action, geofenceEvent.location); 9 | * }); 10 | * ``` 11 | */ 12 | interface GeofenceEvent { 13 | /** 14 | * The device system time when the Geofence event was received by the OS. 15 | * __Note__: this can differ from the timestamp of the triggering location responsible for the geofence (the triggering location can be from the past). 16 | */ 17 | timestamp: string; 18 | /** 19 | * The identifier of the geofence which fired. 20 | */ 21 | identifier: string; 22 | /** 23 | * The transition type: `ENTER`, `EXIT`, `DWELL` 24 | */ 25 | action: string; 26 | /** 27 | * The [[Location]] where the geofence transition occurred. 28 | */ 29 | location: Location; 30 | /** 31 | * Optional [[Geofence.extras]] 32 | */ 33 | extras?: Extras; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/declarations/interfaces/GeofencesChangeEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | declare module "react-native-background-geolocation" { 4 | /** 5 | * The event-object provided to [[BackgroundGeolocation.onGeofencesChange]]. 6 | * 7 | * The [[GeofencesChangeEvent]] provides only the *changed* geofences, those which just activated or de-activated. 8 | * 9 | * @example 10 | * ```typescript 11 | * BackgroundGeolocation.onGeofencesChange(geofencesChangeEvent => { 12 | * console.log("[geofenceschange] ", geofencesChangeEvent.on, geofencesChangeEvent.off); 13 | * }); 14 | * ``` 15 | * ### ⚠️ Note: 16 | * - When **all** geofences have been removed, empty lists will be provided for both [[on]] & [[off]]. 17 | */ 18 | interface GeofencesChangeEvent { 19 | on: Array; 20 | off: Array; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/declarations/interfaces/HeadlessEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | 4 | declare module "react-native-background-geolocation" { 5 | /** 6 | * This is the event-object provided to Android headless-tasks registered via [[BackgroundGeolocation.registerHeadlessTask]]. 7 | * 8 | * @example 9 | * ```typescript 10 | * const BackgroundGeolocationHeadlessTask = async (event) => { 11 | * const params = event.params; 12 | * console.log("[BackgroundGeolocation HeadlessTask] -", event.name, params); 13 | * 14 | * switch (event.name) { 15 | * case "terminate": 16 | * // Use await for async tasks 17 | * const location = await BackgroundGeolocation.getCurrentPosition({ 18 | * samples: 1, 19 | * persist: false 20 | * }); 21 | * console.log("[BackgroundGeolocation HeadlessTask] - getCurrentPosition:", location); 22 | * break; 23 | * } 24 | * // You must await all work you do in your task. 25 | * // Headless-tasks are automatically terminated after executing the last line of your function. 26 | * await doWork(); 27 | * } 28 | * 29 | * BackgroundGeolocation.registerHeadlessTask(BackgroundGeolocationHeadlessTask); 30 | * ``` 31 | * 32 | * ### ℹ️ See also: 33 | * - 📘 [Android Headless Mode](github:wiki/Android-Headless-Mode). 34 | * - [[BackgroundGeolocation.registerHeadlessTask]] 35 | * - [[Config.enableHeadless]] 36 | * 37 | */ 38 | interface HeadlessEvent { 39 | /** 40 | * BackgroundGeolocation event name (eg: `location`, `motionchange`, `terminate`, `http`, etc). 41 | */ 42 | name: Event; 43 | /** 44 | * General event params according to the context of the event name. 45 | */ 46 | params: Map; 47 | } 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/declarations/interfaces/HeartbeatEvent.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * The event-object provided to [[BackgroundGeolocation.onHeartbeat]] 4 | * 5 | * @example 6 | * ```typescript 7 | * BackgroundGeolocation.onHeartbeat(heartbeatEvent => { 8 | * console.log("[heartbeat] ", heartbeatEvent); 9 | * }); 10 | * ``` 11 | */ 12 | interface HeartbeatEvent { 13 | /** 14 | * The last-known location. 15 | * ### ⚠️ Note: 16 | * - The *heartbeat* event does not actively engage location-services. If you wish to get the current location in your `callback`, use [[getCurrentPosition]]. 17 | */ 18 | location: Location; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/declarations/interfaces/LocationAuthorizationAlert.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * __`[iOS only]`__ Controls the text-elements of the plugin's location-authorization dialog. 4 | * 5 | * When you configure the plugin [[locationAuthorizationRequest]] __`Always`__ or __`WhenInUse`__ and the user *changes* the mode in the app's location-services settings or disabled location-services, the plugin will display an Alert dialog directing the user to the **Settings** screen. **`locationAuthorizationAlert`** allows you to configure all the Strings for that Alert popup and accepts an `{}` containing the following keys: 6 | * 7 | * ![](https://dl.dropboxusercontent.com/s/wyoaf16buwsw7ed/docs-locationAuthorizationAlert.jpg?dl=1) 8 | */ 9 | interface LocationAuthorizationAlert { 10 | /** 11 | * The title of the alert if user changes, for example, the location-request to `WhenInUse` when you requested `Always`. 12 | * 13 | * Defaults to `Location services are off`. 14 | */ 15 | titleWhenOff: string; 16 | /** 17 | * The title of the alert when user disables location-services or changes the authorization request to `Never`. 18 | * 19 | * Defaults to `Background location is not enabled`. 20 | */ 21 | titleWhenNotEnabled: string; 22 | /** 23 | * The body text of the alert. 24 | * 25 | * Defaults to: `To use background location, you must enable {locationAuthorizationRequest} in the Location Services settings`. 26 | */ 27 | instructions: string; 28 | /** 29 | * Cancel button label. 30 | * 31 | * Defaults to `Cancel`. 32 | */ 33 | cancelButton: string; 34 | /** 35 | * Settings button label. 36 | * 37 | * Defaults to `Settings`. 38 | */ 39 | settingsButton: string; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/declarations/interfaces/MotionActivityEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "react-native-background-geolocation" { 4 | /** 5 | * The event-object provided to [[BackgroundGeolocation.onActivityChange]]. 6 | * 7 | * @example 8 | * ```typescript 9 | * BackgroundGeolocation.onActivityChange(activityChangeEvent => { 10 | * console.log("[activitychange] ", activityChangeEvent.activity, activityChangeEvent.confidence); 11 | * }); 12 | * ``` 13 | */ 14 | interface MotionActivityEvent { 15 | /** 16 | * The reported device motion activity. 17 | * 18 | * | Activity Name | 19 | * |----------------| 20 | * | `still` | 21 | * | `walking` | 22 | * | `on_foot` | 23 | * | `running` | 24 | * | `on_bicycle` | 25 | * | `in_vehicle` | 26 | * | `unknown` | 27 | */ 28 | activity: MotionActivityType; 29 | /** 30 | * Confidence of the reported device motion activity in %. 31 | */ 32 | confidence: number; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/declarations/interfaces/MotionChangeEvent.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * The event-object provided to [[BackgroundGeolocation.onMotionChange]] when the SDK changes state between *moving* and *stationary*. 4 | */ 5 | interface MotionChangeEvent { 6 | /** 7 | * `true` when the device has begun *moving* and the SDK engaged location-tracking. `false` when *stationary*. 8 | */ 9 | isMoving: boolean; 10 | /** 11 | * The corresponding [[Location]] where the event occurred. 12 | */ 13 | location: Location; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/declarations/interfaces/PermissionRationale.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | declare module "react-native-background-geolocation" { 4 | 5 | /** 6 | * __[Android only]__ Configuration for showing an android dialog prior to forwarding the user to a permission settings-screen. 7 | * 8 | */ 9 | interface PermissionRationale { 10 | /** 11 | * The title of the dialog window. 12 | */ 13 | title?: string; 14 | 15 | /** 16 | * The body text of the dialog. 17 | * Provide an explanation of why you need this permission, similar in purpose to iOS' __`NSLocationAlwaysAndWhenInUseUsageDescription`__. 18 | */ 19 | message?: string; 20 | 21 | /** 22 | * The text to display on the *positive action* button. 23 | */ 24 | positiveAction?: string; 25 | 26 | /** 27 | * The text to display on the *negative action* button (eg: *Cancel*) 28 | */ 29 | negativeAction?: string; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/declarations/interfaces/ProviderChangeEvent.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "react-native-background-geolocation" { 4 | /** 5 | * The event-object provided to [[BackgroundGeolocation.onProviderChange]] 6 | * 7 | * @example 8 | * ```typescript 9 | * BackgroundGeolocation.onProviderChange(providerChangeEvent => { 10 | * console.log("[providerchange] ", provider.enabled, provider.status, provider.network, provider.gps); 11 | * }); 12 | * ``` 13 | */ 14 | interface ProviderChangeEvent { 15 | /** 16 | * `true` When device location-services are enabled. 17 | */ 18 | enabled: boolean; 19 | /** 20 | * Authorization status of location-services. For iOS, this will tell you if the user has enabled "Always" or "When in Use" authorization. 21 | * 22 | * | Name | Platform | 23 | * |-----------------------------------------|---------------| 24 | * | [[AUTHORIZATION_STATUS_NOT_DETERMINED]] | iOS only | 25 | * | [[AUTHORIZATION_STATUS_RESTRICTED]] | iOS only | 26 | * | [[AUTHORIZATION_STATUS_DENIED]] | iOS & Android | 27 | * | [[AUTHORIZATION_STATUS_ALWAYS]] | iOS & Android | 28 | * | [[AUTHORIZATION_STATUS_WHEN_IN_USE]] | iOS only | 29 | * 30 | * ### ℹ️ Note: 31 | * - When Android location permission is **granted**, `status` == [[AUTHORIZATION_STATUS_ALWAYS]], otherwise [[AUTHORIZATION_STATUS_DENIED]]. 32 | */ 33 | status: AuthorizationStatus; 34 | /** 35 | * `true` if network geolocation provider is available. 36 | */ 37 | network: boolean; 38 | /** 39 | * `true` if GPS geolocation provider is available. 40 | */ 41 | gps: boolean; 42 | /** 43 | * __`[iOS 14+]`__ iOS 14 has introduced a new __`[Precise: On]`__ switch on the location authorization dialog allowing users to disable high-accuracy location. 44 | * 45 | * This attribute shows the state of that switch: 46 | * - Enabled: [[BackgroundGeolocation.ACCURACY_AUTHORIZATION_FULL]]. 47 | * - Disabled, [[BackgroundGeolocation.ACCURACY_AUTHORIZATION_REDUCED]]. 48 | * 49 | * ![](https://dl.dropbox.com/s/dj93xpg51vspqk0/ios-14-precise-on.png?dl=1) 50 | * 51 | * @example 52 | * 53 | * ```javascript 54 | * BackgroundGeolocation.onProviderChange((event) => { 55 | * let authorizationStatus = event.authorizationStatus; 56 | * if (authorizationStatus == BackgroundGeolocation.ACCURACY_AUTHORIZATION_REDUCED) { 57 | * // Supply "Purpose" key from Info.plist as 1st argument. 58 | * BackgroundGeolocaiton.requestTemporaryFullAccuracy("Delivery").then((accuracyAuthorization) => { 59 | * console.log("[requestTemporaryFullAccuracy]: ", accuracyAuthorization); 60 | * }).catch((error) => { 61 | * console.warn("[requestTemporaryFullAccuracy] ERROR:", error); 62 | * }); 63 | * } 64 | * }); 65 | * ``` 66 | * 67 | * __See also:__ 68 | * - [[BackgroundGeolocation.requestTemporaryFullAccuracy]] 69 | * - [What's new in iOS 14 `CoreLocation`](https://levelup.gitconnected.com/whats-new-with-corelocation-in-ios-14-bd28421c95c4) 70 | * 71 | */ 72 | accuracyAuthorization: AccuracyAuthorization; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/declarations/interfaces/SQLQuery.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Used for selecting a range of records from the SDK"s database. 4 | * Used with the methods: 5 | * - [[Logger.getLog]] 6 | * - [[Logger.emailLog]] 7 | * - [[Logger.uploadLog]] 8 | * 9 | * ```typescript 10 | * // Constrain results between optionl start/end dates using a SQLQuery 11 | * let log = await BackgroundGeolocation.logger.getLog({ 12 | * start: Date.parse("2019-10-21 13:00"), // <-- optional HH:mm:ss 13 | * end: Date.parse("2019-10-22") 14 | * }); 15 | * 16 | * // Or just a start date 17 | * let log = await BackgroundGeolocation.logger.getLog({ 18 | * start: Date.parse("2019-10-21 13:00") 19 | * }); 20 | * 21 | * // Or just an end date 22 | * BackgroundGeolocation.logger.uploadLog("http://my.server.com/users/123/logs", { 23 | * end: Date.parse("2019-10-21") 24 | * )); 25 | * 26 | * // Select first 100 records from log 27 | * let Logger = BackgroundGeolocation.logger; 28 | * Logger.emailLog("foo@bar.com", { 29 | * order: Logger.ORDER_ASC, 30 | * limit: 100 31 | * )); 32 | * 33 | * // Select most recent 100 records from log 34 | * let Logger = BackgroundGeolocation.logger; 35 | * Logger.emailLog("foo@bar.com", { 36 | * order: Logger.ORDER_DESC, 37 | * limit: 100 38 | * )); 39 | * ``` 40 | */ 41 | interface SQLQuery { 42 | /** 43 | * Start date of logs to select (unix timestamp) 44 | */ 45 | start?:number; 46 | /** 47 | * End date of logs to select (unix timestamp) 48 | */ 49 | end?:number; 50 | /** 51 | * Limit number of records returned. 52 | */ 53 | limit?:number; 54 | /** 55 | * Order of results [[Logger.ORDER_ASC]] or [[Logger.ORDER_DESC]]. 56 | * `1` = `ASC`; `-1` = `DESC`. 57 | */ 58 | order?:SQLQueryOrder; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/declarations/interfaces/Sensors.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Detected device sensors related to motion-detection. 4 | */ 5 | interface Sensors { 6 | /** 7 | * `ios` | `android` 8 | */ 9 | platform: string; 10 | /** 11 | * `true` when the device has an accelerometer. 12 | */ 13 | accelerometer: boolean; 14 | /** 15 | * `true` when the device has a magnetometer (compass). 16 | */ 17 | magnetometer: boolean; 18 | /** 19 | * `true` when the device has a gyroscope. 20 | */ 21 | gyroscope: boolean; 22 | /** 23 | * __[Android only]__ `true` when the Android device has significant motion hardware. 24 | */ 25 | significant_motion?: boolean; 26 | /** 27 | * __[iOS only]__ `true` when the device has an __M7__ motion co-processor (iPhone 5S and up). 28 | */ 29 | motion_hardware?: boolean; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/declarations/interfaces/State.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "react-native-background-geolocation" { 4 | /** 5 | * This `State` object contains all the provided [[Config]] options in addition to: 6 | * - [[enabled]]. 7 | * - [[schedulerEnabled]]. 8 | * - [[trackingMode]]. 9 | * - [[odometer]]. 10 | * - [[didLaunchInBackground]]. 11 | * - [[didDeviceReboot]] 12 | */ 13 | interface State extends Config { 14 | /** 15 | * `true` when the SDK has been enabled via methods [[start]] or [[startGeofences]]. When `false`, the 16 | * SDK is completely __OFF__. No tracking of any kind will occur. The SDK will consume no energy. 17 | */ 18 | enabled: boolean; 19 | /** 20 | * `true` when the SDK is currently configured with a [[schedule]] and [[startSchedule]] has been executed. 21 | * [[stopSchedule]] will set this to `false`. 22 | */ 23 | schedulerEnabled: boolean; 24 | /** 25 | | Value | Description | 26 | |------------|-----------------------------------| 27 | | __`0`__ | Monitoring geofences only | 28 | | __`1`__ | Monitoring location + geofences | 29 | */ 30 | trackingMode: TrackingMode; 31 | /** 32 | * The current distance-traveled. 33 | * ### ℹ️ See also: 34 | * - [[resetOdometer]], [[setOdometer]] 35 | * - [[getOdometer]] 36 | */ 37 | odometer: number; 38 | /** 39 | * `true` when the iOS app was launched in the background. Always `false` for Android. 40 | * iOS apps can be launched in the background due to a background-fetch event, geofence events or exiting the [[Config.stationaryRadius]]. 41 | * 42 | * One might use this flag to choose to load only minimal resources until the iOS app is determined to have launched into the foreground. 43 | * 44 | */ 45 | didLaunchInBackground: boolean; 46 | /** 47 | * Indicates if the app was launched after the device was rebooted. 48 | */ 49 | didDeviceReboot: boolean; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/declarations/interfaces/Subscription.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Object returned by BackgroundGeolocation event-listeners. `Subscription` contains just a single method [[remove]], used for removing an event-listener. 4 | * 5 | * - [[BackgroundGeolocation.onLocation]] 6 | * - [[BackgroundGeolocation.onMotionChange]] 7 | * - [[BackgroundGeolocation.onHttp]] 8 | * - [[BackgroundGeolocation.onHeartbeat]] 9 | * - [[BackgroundGeolocation.onProviderChange]] 10 | * - [[BackgroundGeolocation.onActivityChange]] 11 | * - [[BackgroundGeolocation.onGeofence]] 12 | * - [[BackgroundGeolocation.onGeofencesChange]] 13 | * - [[BackgroundGeolocation.onEnabledChange]] 14 | * - [[BackgroundGeolocation.onConnectivityChange]] 15 | * - [[BackgroundGeolocation.onSchedule]] 16 | * - [[BackgroundGeolocation.onPowerSaveChange]] 17 | * - [[BackgroundGeolocation.onNotificationAction]] 18 | * - [[BackgroundGeolocation.onAuthorization]] 19 | * 20 | * In the past, one would remove event-listeners using the __now-deprectated__ [[BackgroundGeolocation.removeListener]]. 21 | * 22 | * ## Removing an event-listener: 23 | * 24 | * @example 25 | * ```typescript 26 | * // Event-listeners return a Subscription instance, containing a .remove() method. 27 | * const subscription = BackgroundGeolocation.onLocation(location => { 28 | * console.log("[onLocation] ", location); 29 | * }); 30 | * . 31 | * . 32 | * . 33 | * // Later, to remove the event-listener: 34 | * subscription.remove(); 35 | * ``` 36 | * 37 | * One might typically manage a collection of `Subscription` instances 38 | * 39 | * @example 40 | * ```typescript 41 | * import BackgroundGeolocation, { 42 | * Location, 43 | * Subscription 44 | * } from ... 45 | * 46 | * // Your custom Collection of Subscription instances. 47 | * const SUBSCRIPTIONS = []; 48 | * 49 | * // Your custom method to push a Subscription instance. 50 | * const subscribe = (subscription:Subscription) => { 51 | * SUBSCRIPTIONS.push(subscription); 52 | * } 53 | * 54 | * // Your custom method to interate your SUBSCRIPTIONS and .remove each. 55 | * const unsubscribe = () => { 56 | * SUBSCRIPTIONS.forEach((subscription:Subscription) => subscription.remove()); 57 | * } 58 | * 59 | * const initBackgroundGeolocation = () { 60 | * // Create event-listeners as usual, feeding the returned Subscription into 61 | * // your custom subscribe() method. 62 | * subscribe(BackgroundGeolocation.onLocation((location:Location) => { 63 | * console.log('[onLocation]', location); 64 | * }); 65 | * 66 | * subscribe(BackgroundGeolocation.onMotionChange((location:Location) => { 67 | * console.log('[onMotionChange]', location); 68 | * }); 69 | * 70 | * subscribe(BackgroundGeolocation.onEnabledChange((enabled:boolean) => { 71 | * console.log('[onEnabledChange]', enabled); 72 | * }); 73 | * } 74 | * 75 | * const onDestroyView = () => { 76 | * // Call your custom unsubscribe method 77 | * unsubscribe(); 78 | * } 79 | * 80 | * ``` 81 | */ 82 | interface Subscription { 83 | /** 84 | * Removes a `BackgroundGeolocation` event-listener. 85 | * @example 86 | * ```typescript 87 | * // Event-listeners return a Subscription instance, containing a .remove() method. 88 | * const onLocationSubscription = BackgroundGeolocation.onLocation(location => { 89 | * console.log("[onLocation] ", location); 90 | * }); 91 | * 92 | * const onGeofenceSubscription = BackgroundGeolocation.onGeofence(event => { 93 | * console.log("[onGeofence] ", event); 94 | * }); 95 | * . 96 | * . 97 | * . 98 | * // Later, removing event-listeners. 99 | * onLocationSubscription.remove(); 100 | * onGeofenceSubscription.remove(); 101 | */ 102 | remove():void; 103 | } 104 | } -------------------------------------------------------------------------------- /src/declarations/interfaces/TransistorAuthorizationToken.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Response object returned by [[BackgroundGeolocation.findOrCreateTransistorAuthorizationToken]] for configuring the SDK's [[Authorization]] with Transistor Software's Demo Server at [http://tracker.transistorsoft.com](http://tracker.transistorsoft.com). 4 | * 5 | * You may also run your own instance of Demo Server locally. See [background-geolocation-console](https://github.com/transistorsoft/background-geolocation-console) 6 | * 7 | * The test server is a great way to debug location problems or evalute the SDK's behaviour, since the results can easily be shared with *Transistor Software* when requesting support. 8 | * 9 | * ![](https://dl.dropboxusercontent.com/s/3abuyyhioyypk8c/screenshot-tracker-transistorsoft.png?dl=1) 10 | * 11 | * 12 | * @example 13 | * ```typescript 14 | * // Url to demo server. 15 | * let url = "http://tracker.transistorsoft.com"; 16 | * let orgname = "my-company-name"; 17 | * let username = "my-username"; 18 | * 19 | * // Fetch an authoriztion token from server. The SDK will cache the received token. 20 | * let token = await 21 | * BackgroundGeolocation.findOrCreateTransistorAuthorizationToken(orgname, username, url); 22 | * 23 | * BackgroundGeolocation.ready({ 24 | * transistorAuthorizationToken: token 25 | * }) 26 | * ``` 27 | * 28 | * ## Viewing Your Tracking Results 29 | * 30 | * To *view* your tracking results in the browser, use your configured "Organization Name" and visit: 31 | * 32 | * http://tracker.transistorsoft.com/my-organization-name 33 | * 34 | */ 35 | interface TransistorAuthorizationToken { 36 | /** 37 | * The authorization token to provide to [[Authorization.accessToken]] 38 | * 39 | * @example 40 | * ```typescript 41 | * BackgroundGeolocation.ready({ 42 | * authorization: { 43 | * accessToken: 44 | * } 45 | * }); 46 | * ``` 47 | */ 48 | accessToken:string; 49 | /** 50 | * The token used to request to provide to [[Authorization.refreshToken]] 51 | */ 52 | refreshToken:string; 53 | /** 54 | * The expiry time of the [[Authorization.accessToken]] 55 | */ 56 | expires:number; 57 | /** 58 | * The url to the Transistor Demo server where this token came from. 59 | * __Read only__ 60 | */ 61 | url?: string; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/declarations/interfaces/WatchPositionRequest.d.ts: -------------------------------------------------------------------------------- 1 | declare module "react-native-background-geolocation" { 2 | /** 3 | * Options provided to [[BackgroundGeolocation.watchPosition]]. 4 | * 5 | * @example 6 | * ```typescript 7 | * BackgroundGeolocation.watchPosition((location) => { 8 | * console.log("[watchPosition] -", location); 9 | * }, (errorCode) => { 10 | * console.log("[watchPosition] ERROR -", errorCode); 11 | * }, { 12 | * interval: 1000, 13 | * desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, 14 | * persist: true, 15 | * extras: {foo: "bar"}, 16 | * timeout: 60000 17 | * }); 18 | * ``` 19 | */ 20 | interface WatchPositionRequest { 21 | /** 22 | * Location update interval in `milliseconds`. Defaults to `1000`. 23 | */ 24 | interval?: number; 25 | /** 26 | * Specifies the accuracy required. See [[Config.desiredAccuracy]]. Only [[BackgroundGeolocation.DESIRED_ACCURACY_HIGH]] uses GPS. 27 | * Defaults to [[DESIRED_ACCURACY_HIGH]]. 28 | */ 29 | desiredAccuracy?: LocationAccuracy; 30 | /** 31 | * Set `true` to persist each recorded location to the plugin's database. 32 | * Defaults to `true` when [[State.enabled]], `false` otherwise. 33 | */ 34 | persist?: boolean; 35 | /** 36 | * Arbitrary key/values to append to each recorded location. 37 | */ 38 | extras?: Extras; 39 | /** 40 | * Time in `milliseconds` to wait before firing error callback when location fails to arrive. 41 | * Defaults to `60000`. 42 | */ 43 | timeout?: number; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | --------------------------------------------------------------------------------