Skip to content

Instantly share code, notes, and snippets.

@Bucimis
Last active October 16, 2015 22:37
Show Gist options
  • Save Bucimis/909dbd68edad61ac869c to your computer and use it in GitHub Desktop.
Save Bucimis/909dbd68edad61ac869c to your computer and use it in GitHub Desktop.
Appboy Background Location Tracking

Android

Manifest Set Up

  1. In your AndroidManifest.xml, request fine location permissions:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

  1. In the application element of your AndroidManifest.xml, declare the Appboy location service:

<service android:name="com.appboy.services.AppboyLocationService"/>

Distance and Time Threshold Set Up

Minimum time and distance thresholds between location updates are fully configurable.

Time thresholds are specified in seconds and distance thresholds are specified in meters. We recommend 3600s and 1000.0m respectively.

To enable background location tracking and configure your time and distance thresholds, contact us at support@appboy.com.

In the near future, enabling background location tracking and configuring time and distance thresholds will be possible via the Appboy dashboard.

[Android M] Permissions

With the release of Android M, Android switched from an install-time to a runtime permissions model. To enable location tracking of any kind, location permissions must be obtained from the user explicitly by the app. Once location permissions are obtained, Appboy will begin background location tracking automatically on the next session start.

For more information, see https://developer.android.com/training/permissions/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment