MovementSdk

The main entry point for starting the Movement SDK

Types

Link copied to clipboard
class Builder(context: Context)

Builder for supplying your notification handler and other configuration options on the Movement SDK

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun cancelJourney(callback: (JourneyException?) -> Unit? = null): Unit?

Cancel the current journey, stop all journey updates and set currentJourney to null. If successful, this method will cause a final journey update with a status of "cancelled."

Link copied to clipboard
fun checkinJourney(callback: (JourneyException?) -> Unit? = null): Unit?

Checkin at the current journey's destination, stop all journey updates and set currentJourney to null. If successful, this method will cause a final journey update with a status of "completed."

Link copied to clipboard
fun completeJourney(callback: (JourneyException?) -> Unit? = null): Unit?

Complete the current journey, stop all journey updates and set currentJourney to null. If successful, this method will cause a final journey update with a status of "completed."

Link copied to clipboard

Disables the foreground notification configuration. Useful for when your user opts out of the notification at runtime. You should also save state so you don't initialize it again the next time android.app.Application.onCreate runs.

Link copied to clipboard
fun enableForegroundNotification(notificationChannelId: String, @StringRes notificationText: Int, @StringRes notificationTitle: Int, @DrawableRes notificationIcon: Int, notificationTarget: PendingIntent): MovementSdk

Allow the Movement SDK to use a Foreground service on Android O+ while your user is moving to increase location resolution and timeliness of notifications that you receive. This is required to be called in android.app.Application.onCreate.

Link copied to clipboard

Access data about a currently running journey. This method will return null when there is not current journey running.

Link copied to clipboard

Get the current location of the user and any potential geofences they are located in

Link copied to clipboard
fun getCurrentVisit(context: Context): Visit?

Gives you the currently active visit.

Link copied to clipboard
Link copied to clipboard
fun setEnableDebugLogs(enableDebugLogs: Boolean): MovementSdk

For improved debugging and the enabling of the logs page in the SdkDebugActivity of the movementsdk-debugging module, turn on persistent logs.

Link copied to clipboard
fun setEnableLiveConsoleEvents(enableLiveConsoleEvents: Boolean): MovementSdk

For improved debugging, by allowing of all events on Debug builds to log to the developer console

Link copied to clipboard
fun setEnablePersistentLogs(enablePersistentLogs: Boolean): MovementSdk

For improved live debugging and the enabling of the logs page in the SdkDebugActivity of the movementsdk-debugging module, turn on persistent logs.

Link copied to clipboard

The SDK will suppress exceptions caused when your application throws them in any of the visit notification callbacks so that its running state is not compromised. Because you may still like to be made aware of these, add a ExceptionHandler to be alerted of their existence.

Link copied to clipboard

Sets the LogLevel that the SDK will use when sending its logs to logcat and the persistent log storage.

Link copied to clipboard

Sets the notification handler that all of your visit notifications will be sent to.

Link copied to clipboard

If your application authenticates its users with Foursquare you can pass the oauth token here for use by the Movement SDK. Using an authenticated user allows the Movement SDK to give more personalized results that may result in better accuracy.

Link copied to clipboard
fun setUserInfo(userInfo: UserInfo?, persisted: Boolean = false): MovementSdk

Set arbitrary data that will be passed to your servers on visit notifications.

Link copied to clipboard
fun startJourney(destinationId: String, destinationType: JourneyDestinationType, metadata: Map<String, String> = emptyMap(), callback: (Result<Journey, JourneyException>) -> Unit? = null): Unit?

Begin a journey to a Foursquare venue or geofence by passing the Foursquare venue id as well any metadata you'd like to accompany the start request. Once a journey has been started you will automatically receive updates via the NotificationHandler.handleJourneyUpdate delegate method. Updates will occur roughly once per minute while the journey is active.

Properties

Link copied to clipboard

Retrieves the currently configured user info data for updating.

Link copied to clipboard
val userState: LastKnownUserState?