Skip to content

Commit

Permalink
Added notificationsEnabled config (#269)
Browse files Browse the repository at this point in the history
Clarified `startForeground` and its notifications
  • Loading branch information
danielgindi authored and mauron85 committed Aug 23, 2018
1 parent 73e643a commit b20a6ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,13 @@ Configure options:
| `fastestInterval` | `Number` | Android | Fastest rate in milliseconds at which your app can handle location updates. **@see** [Android docs](https://developers.google.com/android/reference/com/google/android/gms/location/LocationRequest.html#getFastestInterval()). | ACT | 120000 |
| `activitiesInterval` | `Number` | Android | Rate in milliseconds at which activity recognition occurs. Larger values will result in fewer activity detections while improving battery life. | ACT | 10000 |
| `stopOnStillActivity` | `Boolean` | Android | @deprecated stop location updates, when the STILL activity is detected | ACT | true |
| `startForeground` | `Boolean` | Android | show service notification when in foreground | all | false |
| `notificationTitle` | `String` optional | Android | Custom notification title in the drawer. | all | "Background tracking" |
| `notificationText` | `String` optional | Android | Custom notification text in the drawer. | all | "ENABLED" |
| `notificationIconColor` | `String` optional | Android | The accent color to use for notification. Eg. **#4CAF50**. | all | |
| `notificationIconLarge` | `String` optional | Android | The filename of a custom notification icon. **@see** Android quirks. | all | |
| `notificationIconSmall` | `String` optional | Android | The filename of a custom notification icon. **@see** Android quirks. | all | |
| `notificationsEnabled` | `Boolean` | Android | Enable/disable local notifications when tracking and syncing locations | all | true |
| `startForeground` | `Boolean` | Android | Allow location sync service to run in foreground state. Foreground state also requires a notification to be presented to the user. | all | false |
| `notificationTitle` | `String` optional | Android | Custom notification title in the drawer. (goes with `startForeground`) | all | "Background tracking" |
| `notificationText` | `String` optional | Android | Custom notification text in the drawer. (goes with `startForeground`) | all | "ENABLED" |
| `notificationIconColor` | `String` optional | Android | The accent color to use for notification. Eg. **#4CAF50**. (goes with `startForeground`) | all | |
| `notificationIconLarge` | `String` optional | Android | The filename of a custom notification icon. **@see** Android quirks. (goes with `startForeground`) | all | |
| `notificationIconSmall` | `String` optional | Android | The filename of a custom notification icon. **@see** Android quirks. (goes with `startForeground`) | all | |
| `activityType` | `String` | iOS | [AutomotiveNavigation, OtherNavigation, Fitness, Other] Presumably, this affects iOS GPS algorithm. **@see** [Apple docs](https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/instp/CLLocationManager/activityType) for more information | all | "OtherNavigation" |
| `pauseLocationUpdates` | `Boolean` | iOS | Pauses location updates when app is paused. **@see* [Apple docs](https://developer.apple.com/documentation/corelocation/cllocationmanager/1620553-pauseslocationupdatesautomatical?language=objc) | all | false |
| `saveBatteryOnBackground` | `Boolean` | iOS | Switch to less accurate significant changes and region monitory when in background | all | false |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static Config fromMap(ReadableMap options) throws JSONException {
if (options.hasKey("stopOnTerminate")) config.setStopOnTerminate(options.getBoolean("stopOnTerminate"));
if (options.hasKey("startOnBoot")) config.setStartOnBoot(options.getBoolean("startOnBoot"));
if (options.hasKey("startForeground")) config.setStartForeground(options.getBoolean("startForeground"));
if (options.hasKey("notificationsEnabled")) config.setNotificationsEnabled(options.getBoolean("notificationsEnabled"));
if (options.hasKey("locationProvider")) config.setLocationProvider(options.getInt("locationProvider"));
if (options.hasKey("interval")) config.setInterval(options.getInt("interval"));
if (options.hasKey("fastestInterval")) config.setFastestInterval(options.getInt("fastestInterval"));
Expand Down Expand Up @@ -149,6 +150,9 @@ public static ReadableMap toMap(Config config) {
if (config.getStartForeground() != null) {
out.putBoolean("startForeground", config.getStartForeground());
}
if (config.getNotificationsEnabled() != null) {
out.putBoolean("notificationsEnabled", config.getNotificationsEnabled());
}
if (config.getLocationProvider() != null) {
out.putInt("locationProvider", config.getLocationProvider());
}
Expand Down

0 comments on commit b20a6ec

Please sign in to comment.