MoveSdkAndroidConfig

MOVE Models(React Native)

When running an Android application in background, several limits apply, which also have impact on retrieving locations. To circumvent this, an application needs to show a foreground service with a notification visible to the user. Therefore, it is necessary to pass an additional notification configuration object for Android. For more information on that please check notification management.

Here is how moveSdkAndroidConfig could look like:

import { NotificationConfig, MoveSdkAndroidConfig } from 'react-native-move-sdk';

const tripChannel = {
	id: 'CT',
	name: 'Trips',
	description: 'Trips Description',ja
};

const recognitionNotification: NotificationConfig = {
	title: 'MOVE SDK Trip Recognition',
	text: 'SDK trip recognition is running',
	channel: tripChannel,
};

const tripNotification: NotificationConfig = {
	title: 'MOVE SDK Trip Running',
	text: 'SDK is recording your trip',
	channel: tripChannel,
};

const moveSdkAndroidConfig: MoveSdkAndroidConfig = {
	notifications: {
		recognitionNotification,
		tripNotification,
	},
};

recognitionNotificationarrow-up-right config object - whenever the MOVE SDK tries to detect for example activities, trips or even more.

tripNotificationarrow-up-right config object - when there is an active trip (MoveTripState .Running).

circle-info

Don't forget to create a notification channelarrow-up-right

Last updated