2.10.2-2 • Published 8 months ago

@dolphintechnologies/react-native-move-sdk v2.10.2-2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

react-native-move-sdk

React Native library for MOVE SDK - please see https://docs.movesdk.com/move-platform for features and details about the MOVE SDK.

Installation

npm install react-native-move-sdk --save
#or
yarn add react-native-move-sdk

iOS

Add to the AppDelegate.m file

#import <ReactMoveSDK/MoveSdk.h>
...
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [RCTMoveSdk initIfPossibleWithLaunchOptions:launchOptions];
  return YES;
}

Android

Add the DolphinSDK repository to the build.gradle file

// android/build.gradle
allprojects {
	repositories {
		maven {
			url "https://dolphin.jfrog.io/artifactory/move-sdk-libs-release"
			content {
				includeGroup "io.dolphin.move"
			}
		}
	}
}

Add to the MainApplication.java file

import in.dolph.move.sdk.NativeMoveSdkWrapper;
...
public class MainApplication extends Application implements ReactApplication {
	private NativeMoveSdkWrapper sdkWrapper;
	...
	public void onCreate() {
		super.onCreate();
		sdkWrapper = NativeMoveSdkWrapper.getInstance(this);
		sdkWrapper.init(this);
		...
	}
}

Usage

See https://docs.movesdk.com/move-platform/sdk/api-interface/react-native/intialization

import MoveSdk from 'react-native-move-sdk';
...
const tripChannel = {
	id: 'CT',
	name: 'Trips',
	description: 'Trips Description',
};
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 auth = {
	userId: ...,
	accessToken: ...,
	refreshToken: ...,
	projectId: ...,
};

export const CONFIG: MoveSdkConfig = {
	timelineDetectionServices: ['DRIVING', 'BICYCLE', 'PUBLIC_TRANSPORT', 'WALKING'],
	drivingServices: ['DISTRACTION_FREE_DRIVING', 'DRIVING_BEHAVIOUR'],
	walkingServices: []
};

export const ANDROID_CONFIG: MoveSdkAndroidConfig = {
	notifications: {
		recognitionNotification,
		tripNotification,
	}
};

MoveSdk.setup(CONFIG, auth, ANDROID_CONFIG)

Methods

See: https://docs.movesdk.com/move-platform/sdk/api-interface/react-native/services

Required permissions description ios and android...

MoveSdk.getState();
MoveSdk.resolveError();
MoveSdk.getErrors();
MoveSdk.getWarnings();
MoveSdk.startAutomaticDetection();
MoveSdk.stopAutomaticDetection();
MoveSdk.initiateAssistanceCall();
MoveSdk.shutdown();

...

Listener

MoveSdk.addSdkStateListener((state: SdkState) => {
	...
});

MoveSdk.addTripStateListener((state: TripState) => {
	...
});

MoveSdk.addAuthStateListener((event: AuthStateEvent) => {
	...
});

MoveSdk.addAppEventListener((event: string) => {
	...
});

MoveSdk.addWarningsListener((warnings: ErrorListType) => {
	...
});

MoveSdk.addErrorsListener((errors: ErrorListType) => {
	...
});

MoveSdk.addLogListener((log: MoveSdkLog) => {
	...
});

License

MIT

2.10.2-2

8 months ago

2.10.2-1

8 months ago

2.10.1-1

9 months ago

2.10.0-1

11 months ago

2.9.0-1

11 months ago

2.9.1-2

11 months ago

2.8.1-1

1 year ago

2.7.1-alpha.11

1 year ago

2.7.1-alpha.10

1 year ago

2.7.1-alpha.9

1 year ago

2.7.1-alpha.8

1 year ago

2.7.1-alpha.7

1 year ago

2.7.1-alpha.6

1 year ago

2.7.1-alpha.5

1 year ago

2.7.1-alpha.4

1 year ago

2.7.1-alpha.3

1 year ago

2.7.1-alpha.2

1 year ago

2.7.1-alpha.1

1 year ago

2.7.0-2

1 year ago

2.7.0-1

1 year ago

2.6.9-7

1 year ago

2.6.9-6

1 year ago

2.6.9-5

1 year ago

2.6.8-1-fix

1 year ago

2.6.9-4

1 year ago

2.6.9-3

1 year ago

2.6.9-2

1 year ago

2.6.9-1

1 year ago

2.6.8-2

1 year ago

2.6.8-1

1 year ago

2.6.7-1

1 year ago

2.6.6-4

1 year ago

2.6.6-3

1 year ago

2.6.6-2

2 years ago

2.6.6-1

2 years ago

2.6.5-1

2 years ago

2.6.5

2 years ago

2.6.4

2 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.5

3 years ago