Skip to content

Commit

Permalink
Added notificationsEnabled config
Browse files Browse the repository at this point in the history
  • Loading branch information
mauron85 committed Aug 23, 2018
1 parent dd343d8 commit 1a3ed1c
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 @@ -233,12 +233,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 @@ -33,6 +33,9 @@ public static Config fromJSONObject (JSONObject jObject) throws JSONException {
if (jObject.has("debug")) {
config.setDebugging(jObject.getBoolean("debug"));
}
if (jObject.has("notificationsEnabled")) {
config.setNotificationsEnabled(jObject.getBoolean("notificationsEnabled"));
}
if (jObject.has("notificationTitle")) {
config.setNotificationTitle(!jObject.isNull("notificationTitle") ? jObject.getString("notificationTitle") : Config.NullString);
}
Expand Down Expand Up @@ -105,6 +108,7 @@ public static JSONObject toJSONObject(Config config) throws JSONException {
json.put("distanceFilter", config.getDistanceFilter());
json.put("desiredAccuracy", config.getDesiredAccuracy());
json.put("debug", config.isDebugging());
json.put("notificationsEnabled", config.getNotificationsEnabled());
json.put("notificationTitle", config.getNotificationTitle() != Config.NullString ? config.getNotificationTitle() : JSONObject.NULL);
json.put("notificationText", config.getNotificationText() != Config.NullString ? config.getNotificationText() : JSONObject.NULL);
json.put("notificationIconLarge", config.getLargeNotificationIcon() != Config.NullString ? config.getLargeNotificationIcon() : JSONObject.NULL);
Expand Down

0 comments on commit 1a3ed1c

Please sign in to comment.