2.7.1-alpha.10 • Published 4 days ago

@dolphintechnologies/react-native-move-sdk v2.7.1-alpha.10

Weekly downloads
-
License
MIT
Repository
-
Last release
4 days ago

react-native-move-sdk

React Native library for MOVE SDK - please see https://docs.movesdk.com/move/ 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/sdk-1/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/sdk-1/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) => {
	...
});

License

MIT

2.7.1-alpha.10

4 days ago

2.7.1-alpha.9

16 days ago

2.7.1-alpha.8

22 days ago

2.7.1-alpha.7

1 month ago

2.7.1-alpha.6

1 month ago

2.7.1-alpha.5

1 month ago

2.7.1-alpha.4

2 months ago

2.7.1-alpha.3

2 months ago

2.7.1-alpha.2

2 months ago

2.7.1-alpha.1

2 months ago

2.7.0-2

2 months ago

2.7.0-1

2 months ago

2.6.9-7

2 months ago

2.6.9-6

2 months ago

2.6.9-5

2 months ago

2.6.8-1-fix

2 months ago

2.6.9-4

2 months ago

2.6.9-3

3 months ago

2.6.9-2

3 months ago

2.6.9-1

3 months ago

2.6.8-2

3 months ago

2.6.8-1

4 months ago

2.6.7-1

4 months ago

2.6.6-4

4 months ago

2.6.6-3

4 months ago

2.6.6-2

5 months ago

2.6.6-1

5 months ago

2.6.5-1

5 months ago

2.6.5

6 months ago

2.6.4

6 months ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago