react-native-move-sdk 2.12.0 → 2.14.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle.kts +42 -0
- package/android/gradle.properties +16 -6
- package/android/settings.gradle.kts +35 -0
- package/android/src/{main/java/in/dolph/move/sdk → legacy}/MoveSdkModule.kt +30 -195
- package/android/src/main/AndroidManifest.xml +1 -11
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/DeviceScanner.kt +19 -21
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/Mapper.kt +3 -2
- package/android/src/main/java/com/movesdk/MoveExtensions.kt +188 -0
- package/android/src/main/java/{in/dolph/move/sdk/MoveSdkRepository.kt → com/movesdk/MoveSdkConfigRepository.kt} +3 -1
- package/android/src/main/java/com/movesdk/MoveSdkPackage.kt +32 -0
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/NativeMoveSdkWrapper.kt +201 -61
- package/android/src/main/java/com/movesdk/extentions/ConnectionExt.kt +52 -0
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/extentions/PermissionUtils.kt +1 -1
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/extentions/SharedPreferencesExt.kt +1 -1
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/metadata/MetadataStorage.kt +1 -1
- package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/metadata/MetadataStorageImpl.kt +2 -2
- package/android/src/main/java/com/movesdk/shared/Constants.kt +39 -0
- package/android/src/turbo/MoveSdkModule.kt +422 -0
- package/ios/MoveSdk.h +13 -0
- package/ios/MoveSdk.mm +717 -0
- package/ios/MoveSdk.swift +1022 -0
- package/ios/{NativeModule/MoveSdkDeviceScanner.swift → MoveSdkDeviceScanner.swift} +1 -1
- package/lib/commonjs/NativeMoveSdk.js +21 -0
- package/lib/commonjs/NativeMoveSdk.js.map +1 -0
- package/lib/commonjs/components/LazyMoveSdk.js +22 -41
- package/lib/commonjs/components/LazyMoveSdk.js.map +1 -1
- package/lib/commonjs/index.js +331 -25
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/package.json +1 -0
- package/lib/module/NativeMoveSdk.js +17 -0
- package/lib/module/NativeMoveSdk.js.map +1 -0
- package/lib/module/components/LazyMoveSdk.js +15 -20
- package/lib/module/components/LazyMoveSdk.js.map +1 -1
- package/lib/module/index.js +337 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/typescript/commonjs/example/src/App.d.ts +2 -0
- package/lib/typescript/commonjs/example/src/App.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/NativeMoveSdk.d.ts +133 -0
- package/lib/typescript/commonjs/src/NativeMoveSdk.d.ts.map +1 -0
- package/lib/typescript/{components → commonjs/src/components}/LazyMoveSdk.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/LazyMoveSdk.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +84 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/module/example/src/App.d.ts +2 -0
- package/lib/typescript/module/example/src/App.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/NativeMoveSdk.d.ts +133 -0
- package/lib/typescript/module/src/NativeMoveSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/components/LazyMoveSdk.d.ts +8 -0
- package/lib/typescript/module/src/components/LazyMoveSdk.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +84 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/package.json +197 -138
- package/react-native-move-sdk.podspec +30 -9
- package/src/NativeMoveSdk.ts +227 -0
- package/src/components/LazyMoveSdk.tsx +2 -2
- package/src/{MoveSdk.ts → index.tsx} +131 -199
- package/android/.project +0 -17
- package/android/build.gradle +0 -153
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -8
- package/android/gradlew +0 -183
- package/android/gradlew.bat +0 -100
- package/android/src/main/java/in/dolph/move/sdk/MoveExtensions.kt +0 -72
- package/android/src/main/java/in/dolph/move/sdk/MoveSdkPackage.kt +0 -19
- package/android/src/main/java/in/dolph/move/sdk/WrapperBtConnectionsReceiver.kt +0 -96
- package/android/src/main/res/drawable-anydpi-v24/ic_notification.xml +0 -13
- package/android/src/main/res/drawable-hdpi/ic_notification.png +0 -0
- package/android/src/main/res/drawable-mdpi/ic_notification.png +0 -0
- package/android/src/main/res/drawable-xhdpi/ic_notification.png +0 -0
- package/android/src/main/res/drawable-xxhdpi/ic_notification.png +0 -0
- package/android/src/main/res/values/strings.xml +0 -9
- package/android/src/main/strings.xml +0 -0
- package/android/src/test/java/io/dolphin/move/MoveWrapperTest.kt +0 -190
- package/ios/MoveSdk-Bridging-Header.h +0 -3
- package/ios/MoveSdk.xcodeproj/project.pbxproj +0 -287
- package/ios/MoveSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/ios/MoveSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/NativeModule/MoveSdk.h +0 -144
- package/ios/NativeModule/MoveSdk.swift +0 -1359
- package/lib/commonjs/MoveSdk.js +0 -443
- package/lib/commonjs/MoveSdk.js.map +0 -1
- package/lib/module/MoveSdk.js +0 -432
- package/lib/module/MoveSdk.js.map +0 -1
- package/lib/typescript/MoveSdk.d.ts +0 -158
- package/lib/typescript/index.d.ts +0 -3
- package/src/index.ts +0 -3
|
@@ -1,156 +1,91 @@
|
|
|
1
|
-
import { NativeModules, NativeEventEmitter, Platform, EmitterSubscription } from 'react-native';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
import { NativeModules, NativeEventEmitter, Platform, type EmitterSubscription } from 'react-native';
|
|
2
|
+
import LazyMoveSdk from './components/LazyMoveSdk';
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
AuthState,
|
|
6
|
+
DrivingService,
|
|
7
|
+
ErrorListType,
|
|
8
|
+
ErrorReasons,
|
|
9
|
+
HealthListItem,
|
|
10
|
+
IssueListService,
|
|
11
|
+
MoveSdkDeviceFilter,
|
|
12
|
+
SdkState,
|
|
13
|
+
ShutdownReturnType,
|
|
14
|
+
TimelineDetectionService,
|
|
15
|
+
TripState,
|
|
16
|
+
WalkingService,
|
|
17
|
+
WarningListType,
|
|
18
|
+
WarningReasons,
|
|
19
|
+
|
|
20
|
+
AuthStateEvent,
|
|
21
|
+
IssueListItem,
|
|
22
|
+
MoveScanResult,
|
|
23
|
+
MoveSdkAndroidConfig,
|
|
24
|
+
MoveSdkAuth,
|
|
25
|
+
MoveSdkConfig,
|
|
26
|
+
MoveSdkDevice,
|
|
27
|
+
MoveSdkDeviceDiscovery,
|
|
28
|
+
MoveSdkOptions,
|
|
29
|
+
MoveSdkLog,
|
|
30
|
+
NotificationConfig,
|
|
31
|
+
} from './NativeMoveSdk';
|
|
32
|
+
|
|
33
|
+
export type {
|
|
34
|
+
AuthState,
|
|
35
|
+
DrivingService,
|
|
36
|
+
ErrorListType,
|
|
37
|
+
ErrorReasons,
|
|
38
|
+
HealthListItem,
|
|
39
|
+
IssueListService,
|
|
40
|
+
MoveSdkDeviceFilter,
|
|
41
|
+
SdkState,
|
|
42
|
+
ShutdownReturnType,
|
|
43
|
+
TimelineDetectionService,
|
|
44
|
+
TripState,
|
|
45
|
+
WalkingService,
|
|
46
|
+
WarningListType,
|
|
47
|
+
WarningReasons,
|
|
48
|
+
|
|
49
|
+
AuthStateEvent,
|
|
50
|
+
IssueListItem,
|
|
51
|
+
MoveScanResult,
|
|
52
|
+
MoveSdkAndroidConfig,
|
|
53
|
+
MoveSdkAuth,
|
|
54
|
+
MoveSdkConfig,
|
|
55
|
+
MoveSdkDevice,
|
|
56
|
+
MoveSdkDeviceDiscovery,
|
|
57
|
+
MoveSdkOptions,
|
|
58
|
+
MoveSdkLog,
|
|
59
|
+
NotificationConfig,
|
|
60
60
|
};
|
|
61
61
|
|
|
62
|
-
export
|
|
62
|
+
export { LazyMoveSdk };
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
const LINKING_ERROR =
|
|
65
|
+
`The package 'react-native-move-sdk' doesn't seem to be linked. Make sure: \n\n` +
|
|
66
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
67
|
+
'- You rebuilt the app after installing the package\n' +
|
|
68
|
+
'- You are not using Expo Go\n';
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
| 'CPU_USAGE'
|
|
69
|
-
| 'DISK_USAGE'
|
|
70
|
-
| 'INTERNET_USAGE'
|
|
71
|
-
| 'MEMORY_USAGE'
|
|
72
|
-
| 'NEW_VERSION'
|
|
73
|
-
| 'UNIMPLEMENTED_LISTENERS';
|
|
70
|
+
// @ts-expect-error
|
|
71
|
+
const isTurboModuleEnabled = global.__turboModuleProxy != null;
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export type MoveHealthScore = Array<HealthListItem>;
|
|
81
|
-
|
|
82
|
-
export type ShutdownReturnType = 'NETWORK_ERROR' | 'SUCCESS' | 'UNINITIALIZED';
|
|
83
|
-
|
|
84
|
-
export type MoveSdkConfig = {
|
|
85
|
-
timelineDetectionServices: Array<TimelineDetectionService>;
|
|
86
|
-
drivingServices: Array<DrivingService>;
|
|
87
|
-
walkingServices: Array<WalkingService>;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export type MoveSdkDeviceDiscovery = {
|
|
91
|
-
startDelay?: number;
|
|
92
|
-
duration?: number;
|
|
93
|
-
interval?: number;
|
|
94
|
-
stopScanOnFirstDiscovered?: boolean;
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export type MoveSdkOptions = {
|
|
98
|
-
motionPermissionMandatory?: boolean;
|
|
99
|
-
backgroundLocationPermissionMandatory?: boolean;
|
|
100
|
-
overlayPermissionMandatory?: boolean;
|
|
101
|
-
useBackendConfig?: boolean;
|
|
102
|
-
deviceDiscovery?: MoveSdkDeviceDiscovery;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
export type MoveSdkAuth = {
|
|
106
|
-
userId: string;
|
|
107
|
-
accessToken: string;
|
|
108
|
-
refreshToken: string;
|
|
109
|
-
projectId: number;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export type NotificationConfig = {
|
|
113
|
-
title: string;
|
|
114
|
-
text: string;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export type MoveSdkAndroidConfig = {
|
|
118
|
-
notifications: {
|
|
119
|
-
recognitionNotification: NotificationConfig;
|
|
120
|
-
tripNotification: NotificationConfig;
|
|
121
|
-
};
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
export type ListenerSubscription = EmitterSubscription;
|
|
125
|
-
|
|
126
|
-
export type AuthStateEvent = {
|
|
127
|
-
state: AuthState;
|
|
128
|
-
accessToken?: string;
|
|
129
|
-
refreshToken?: string;
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
export type MoveSdkDeviceFilter = 'beacon' | 'paired' | 'connected';
|
|
133
|
-
|
|
134
|
-
export type MoveSdkDevice = {
|
|
135
|
-
name: string;
|
|
136
|
-
data: string;
|
|
137
|
-
id: string;
|
|
138
|
-
isConnected?: boolean;
|
|
139
|
-
};
|
|
73
|
+
const MoveSdkModule = isTurboModuleEnabled
|
|
74
|
+
? require('./NativeMoveSdk').default
|
|
75
|
+
: NativeModules.MoveSdk;
|
|
140
76
|
|
|
141
|
-
|
|
142
|
-
isDiscovered: boolean;
|
|
143
|
-
device: MoveSdkDevice;
|
|
144
|
-
name: string;
|
|
145
|
-
};
|
|
77
|
+
const eventEmitter = new NativeEventEmitter(MoveSdkModule);
|
|
146
78
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
79
|
+
const NativeMoveSdk = MoveSdkModule
|
|
80
|
+
? MoveSdkModule
|
|
81
|
+
: new Proxy(
|
|
82
|
+
{},
|
|
83
|
+
{
|
|
84
|
+
get() {
|
|
85
|
+
throw new Error(LINKING_ERROR);
|
|
86
|
+
},
|
|
87
|
+
}
|
|
88
|
+
);
|
|
154
89
|
|
|
155
90
|
export default class MoveSdk {
|
|
156
91
|
static READY: SdkState = 'READY';
|
|
@@ -193,9 +128,6 @@ export default class MoveSdk {
|
|
|
193
128
|
}
|
|
194
129
|
|
|
195
130
|
static async setup(config: MoveSdkConfig, auth: MoveSdkAuth, android: MoveSdkAndroidConfig, options?: MoveSdkOptions): Promise<void> {
|
|
196
|
-
const { timelineDetectionServices, drivingServices, walkingServices } = config;
|
|
197
|
-
|
|
198
|
-
const { userId, projectId, accessToken, refreshToken } = auth;
|
|
199
131
|
|
|
200
132
|
let platformParams: Array<string | boolean> = [];
|
|
201
133
|
if (Platform.OS === 'android') {
|
|
@@ -207,26 +139,25 @@ export default class MoveSdk {
|
|
|
207
139
|
throw new Error('MOVE SDK needs notification configuration for Android');
|
|
208
140
|
}
|
|
209
141
|
|
|
210
|
-
platformParams = [
|
|
142
|
+
platformParams = [
|
|
143
|
+
recognitionNotification.title,
|
|
144
|
+
recognitionNotification.text,
|
|
145
|
+
tripNotification.title,
|
|
146
|
+
tripNotification.text,
|
|
147
|
+
];
|
|
211
148
|
}
|
|
212
149
|
|
|
213
150
|
return await NativeMoveSdk.setup(
|
|
214
|
-
|
|
215
|
-
accessToken,
|
|
216
|
-
refreshToken,
|
|
217
|
-
projectId,
|
|
151
|
+
auth,
|
|
218
152
|
// Config
|
|
219
|
-
|
|
220
|
-
drivingServices,
|
|
221
|
-
walkingServices,
|
|
153
|
+
config,
|
|
222
154
|
options,
|
|
223
155
|
// Platform config
|
|
224
|
-
|
|
156
|
+
platformParams
|
|
225
157
|
);
|
|
226
158
|
}
|
|
227
159
|
|
|
228
|
-
static async setupWithCode(code:
|
|
229
|
-
const { timelineDetectionServices, drivingServices, walkingServices } = config;
|
|
160
|
+
static async setupWithCode(code:string, config: MoveSdkConfig, android: MoveSdkAndroidConfig, options?: MoveSdkOptions): Promise<void> {
|
|
230
161
|
|
|
231
162
|
let platformParams: Array<string | boolean> = [];
|
|
232
163
|
if (Platform.OS === 'android') {
|
|
@@ -238,18 +169,21 @@ export default class MoveSdk {
|
|
|
238
169
|
throw new Error('MOVE SDK needs notification configuration for Android');
|
|
239
170
|
}
|
|
240
171
|
|
|
241
|
-
platformParams = [
|
|
172
|
+
platformParams = [
|
|
173
|
+
recognitionNotification.title,
|
|
174
|
+
recognitionNotification.text,
|
|
175
|
+
tripNotification.title,
|
|
176
|
+
tripNotification.text,
|
|
177
|
+
];
|
|
242
178
|
}
|
|
243
179
|
|
|
244
180
|
return await NativeMoveSdk.setupWithCode(
|
|
245
181
|
code,
|
|
246
182
|
// Config
|
|
247
|
-
|
|
248
|
-
drivingServices,
|
|
249
|
-
walkingServices,
|
|
183
|
+
config,
|
|
250
184
|
options,
|
|
251
185
|
// Platform config
|
|
252
|
-
|
|
186
|
+
platformParams
|
|
253
187
|
);
|
|
254
188
|
}
|
|
255
189
|
|
|
@@ -257,11 +191,6 @@ export default class MoveSdk {
|
|
|
257
191
|
NativeMoveSdk.allowMockLocations(allowMockLocations);
|
|
258
192
|
}
|
|
259
193
|
|
|
260
|
-
/* Deprecated */
|
|
261
|
-
static init() {
|
|
262
|
-
NativeMoveSdk.init();
|
|
263
|
-
}
|
|
264
|
-
|
|
265
194
|
static resolveError() {
|
|
266
195
|
NativeMoveSdk.resolveError();
|
|
267
196
|
}
|
|
@@ -334,21 +263,21 @@ export default class MoveSdk {
|
|
|
334
263
|
NativeMoveSdk.setAssistanceMetaData(data);
|
|
335
264
|
}
|
|
336
265
|
|
|
337
|
-
static addTripStateListener(tripStateChanged: (state: TripState) => void):
|
|
266
|
+
static addTripStateListener(tripStateChanged: (state: TripState) => void): EmitterSubscription {
|
|
338
267
|
return eventEmitter.addListener('MOVE_SDK_TRIP_STATE', (event) => tripStateChanged(MoveSdk.tripStateFromNative(event.state)));
|
|
339
268
|
}
|
|
340
269
|
|
|
341
|
-
static addTripStartListener(tripStartTriggered: (start: Date) => void):
|
|
270
|
+
static addTripStartListener(tripStartTriggered: (start: Date) => void): EmitterSubscription {
|
|
342
271
|
return eventEmitter.addListener('MOVE_SDK_TRIP_START', (start) => tripStartTriggered(new Date(Number(start))));
|
|
343
272
|
}
|
|
344
273
|
|
|
345
|
-
static addSdkStateListener(sdkStateChanged: (state: SdkState) => void):
|
|
274
|
+
static addSdkStateListener(sdkStateChanged: (state: SdkState) => void): EmitterSubscription {
|
|
346
275
|
return eventEmitter.addListener('MOVE_SDK_STATE', (event) => {
|
|
347
276
|
sdkStateChanged(MoveSdk.sdkStateFromNative(event.state));
|
|
348
277
|
});
|
|
349
278
|
}
|
|
350
279
|
|
|
351
|
-
static addAuthStateListener(authStateChanged: (event: AuthStateEvent) => void):
|
|
280
|
+
static addAuthStateListener(authStateChanged: (event: AuthStateEvent) => void): EmitterSubscription {
|
|
352
281
|
return eventEmitter.addListener('MOVE_SDK_AUTH_STATE', (event) => {
|
|
353
282
|
const transformedEvent = {
|
|
354
283
|
...event,
|
|
@@ -358,39 +287,39 @@ export default class MoveSdk {
|
|
|
358
287
|
});
|
|
359
288
|
}
|
|
360
289
|
|
|
361
|
-
static addErrorsListener(errorsReceived: (errors: ErrorListType) => void):
|
|
290
|
+
static addErrorsListener(errorsReceived: (errors: ErrorListType) => void): EmitterSubscription {
|
|
362
291
|
return eventEmitter.addListener('MOVE_SDK_ERRORS', (event) => {
|
|
363
292
|
errorsReceived(event.errors);
|
|
364
293
|
});
|
|
365
294
|
}
|
|
366
295
|
|
|
367
|
-
static addWarningsListener(warningsReceived: (warnings: WarningListType) => void):
|
|
296
|
+
static addWarningsListener(warningsReceived: (warnings: WarningListType) => void): EmitterSubscription {
|
|
368
297
|
return eventEmitter.addListener('MOVE_SDK_WARNINGS', (event) => {
|
|
369
298
|
warningsReceived(event.warnings);
|
|
370
299
|
});
|
|
371
300
|
}
|
|
372
301
|
|
|
373
|
-
static addAppEventListener(appEventReceived: (event: string) => void):
|
|
302
|
+
static addAppEventListener(appEventReceived: (event: string) => void): EmitterSubscription {
|
|
374
303
|
return eventEmitter.addListener('MOVE_SDK_APP_EVENT', (event) => {
|
|
375
304
|
appEventReceived(event);
|
|
376
305
|
});
|
|
377
306
|
}
|
|
378
307
|
|
|
379
|
-
static addLogListener(logReceived: (event: MoveSdkLog) => void):
|
|
308
|
+
static addLogListener(logReceived: (event: MoveSdkLog) => void): EmitterSubscription {
|
|
380
309
|
return eventEmitter.addListener('MOVE_SDK_LOG', (event) => {
|
|
381
|
-
|
|
310
|
+
logReceived(event);
|
|
382
311
|
});
|
|
383
312
|
}
|
|
384
313
|
|
|
385
|
-
static addRemoteConfigChangeListener(configChangeReceived: (config: Array<IssueListService>) => void):
|
|
314
|
+
static addRemoteConfigChangeListener(configChangeReceived: (config: Array<IssueListService>) => void): EmitterSubscription {
|
|
386
315
|
return eventEmitter.addListener('MOVE_SDK_CONFIG_UPDATE', (config) => {
|
|
387
316
|
configChangeReceived(config.services);
|
|
388
317
|
});
|
|
389
318
|
}
|
|
390
319
|
|
|
391
|
-
static addHealthListener(scoreReceived: (health:
|
|
392
|
-
|
|
393
|
-
|
|
320
|
+
static addHealthListener(scoreReceived: (health: Array<HealthListItem>) => void): EmitterSubscription {
|
|
321
|
+
return eventEmitter.addListener('MOVE_SDK_HEALTH', (health) => {
|
|
322
|
+
scoreReceived(health);
|
|
394
323
|
});
|
|
395
324
|
}
|
|
396
325
|
|
|
@@ -414,14 +343,6 @@ export default class MoveSdk {
|
|
|
414
343
|
}
|
|
415
344
|
}
|
|
416
345
|
|
|
417
|
-
static async getBluetoothPermission(): Promise<boolean> {
|
|
418
|
-
return await NativeMoveSdk.getBluetoothPermission();
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
static async getBluetoothState(): Promise<boolean> {
|
|
422
|
-
return await NativeMoveSdk.getBluetoothState();
|
|
423
|
-
}
|
|
424
|
-
|
|
425
346
|
static async shutdown(force: boolean = true): Promise<ShutdownReturnType> {
|
|
426
347
|
return await NativeMoveSdk.shutdown(force);
|
|
427
348
|
}
|
|
@@ -466,7 +387,7 @@ export default class MoveSdk {
|
|
|
466
387
|
|
|
467
388
|
// **** PERMISSIONS MODULE END *****
|
|
468
389
|
|
|
469
|
-
static startScanningDevices(sdkDevicesDetected: (state: Array<MoveSdkDevice>) => void, filter: MoveSdkDeviceFilter[] = ['paired'], uuid?: string, manufacturerId?: number):
|
|
390
|
+
static startScanningDevices(sdkDevicesDetected: (state: Array<MoveSdkDevice>) => void, filter: MoveSdkDeviceFilter[] = ['paired'], uuid?: string, manufacturerId?: number): EmitterSubscription {
|
|
470
391
|
const subscription = eventEmitter.addListener('MOVE_SDK_DEVICES', (devices) => {
|
|
471
392
|
sdkDevicesDetected(devices);
|
|
472
393
|
});
|
|
@@ -492,18 +413,26 @@ export default class MoveSdk {
|
|
|
492
413
|
return await NativeMoveSdk.unregisterDevices(devices);
|
|
493
414
|
}
|
|
494
415
|
|
|
495
|
-
static requestBluetoothAlwaysUsagePermission()
|
|
416
|
+
static requestBluetoothAlwaysUsagePermission() {
|
|
496
417
|
NativeMoveSdk.requestBluetoothAlwaysUsagePermission();
|
|
497
418
|
}
|
|
498
419
|
|
|
499
|
-
static
|
|
420
|
+
static async getBluetoothPermission() {
|
|
421
|
+
return await NativeMoveSdk.getBluetoothPermission();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
static async getBluetoothState() {
|
|
425
|
+
return await NativeMoveSdk.getBluetoothState();
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
static addDeviceDiscoveryListener(onScanResult: (state: Array<MoveScanResult>) => void): EmitterSubscription {
|
|
500
429
|
return eventEmitter.addListener('MOVE_SDK_SCAN_RESULT', (results) => {
|
|
501
430
|
onScanResult(results);
|
|
502
431
|
});
|
|
503
432
|
}
|
|
504
433
|
|
|
505
|
-
static addDeviceStateListener(onScanResult: (results: Array<MoveSdkDevice>) => void):
|
|
506
|
-
return eventEmitter.addListener('MOVE_SDK_DEVICE_STATE',
|
|
434
|
+
static addDeviceStateListener(onScanResult: (results: Array<MoveSdkDevice>) => void): EmitterSubscription {
|
|
435
|
+
return eventEmitter.addListener('MOVE_SDK_DEVICE_STATE', results => {
|
|
507
436
|
onScanResult(results);
|
|
508
437
|
});
|
|
509
438
|
}
|
|
@@ -532,11 +461,10 @@ export default class MoveSdk {
|
|
|
532
461
|
}
|
|
533
462
|
|
|
534
463
|
static updateConfig(config: MoveSdkConfig, options?: MoveSdkOptions) {
|
|
535
|
-
|
|
536
|
-
NativeMoveSdk.updateConfig(timelineDetectionServices, drivingServices, walkingServices, options);
|
|
464
|
+
NativeMoveSdk.updateConfig(config, options);
|
|
537
465
|
}
|
|
538
466
|
|
|
539
|
-
static setTripMetadata(metadata?: {
|
|
467
|
+
static setTripMetadata(metadata?: {[key: string]: string}) {
|
|
540
468
|
NativeMoveSdk.setTripMetadata(metadata);
|
|
541
469
|
}
|
|
542
470
|
|
|
@@ -547,4 +475,8 @@ export default class MoveSdk {
|
|
|
547
475
|
static startNativeSdkStateListener() {
|
|
548
476
|
NativeMoveSdk.startNativeSdkStateListener();
|
|
549
477
|
}
|
|
478
|
+
|
|
479
|
+
static async requestHealthPermissions(): Promise<boolean> {
|
|
480
|
+
return await NativeMoveSdk.requestHealthPermissions();
|
|
481
|
+
}
|
|
550
482
|
}
|
package/android/.project
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<projectDescription>
|
|
3
|
-
<name>android_</name>
|
|
4
|
-
<comment>Project android_ created by Buildship.</comment>
|
|
5
|
-
<projects>
|
|
6
|
-
</projects>
|
|
7
|
-
<buildSpec>
|
|
8
|
-
<buildCommand>
|
|
9
|
-
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
|
10
|
-
<arguments>
|
|
11
|
-
</arguments>
|
|
12
|
-
</buildCommand>
|
|
13
|
-
</buildSpec>
|
|
14
|
-
<natures>
|
|
15
|
-
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
|
16
|
-
</natures>
|
|
17
|
-
</projectDescription>
|
package/android/build.gradle
DELETED
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
|
3
|
-
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['MoveSdk_kotlinVersion']
|
|
4
|
-
|
|
5
|
-
repositories {
|
|
6
|
-
mavenCentral()
|
|
7
|
-
google()
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
dependencies {
|
|
12
|
-
classpath 'com.android.tools.build:gradle:7.2.2'
|
|
13
|
-
// noinspection DifferentKotlinGradleVersion
|
|
14
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
apply plugin: 'com.android.library'
|
|
19
|
-
apply plugin: 'kotlin-android'
|
|
20
|
-
|
|
21
|
-
def getExtOrDefault(name) {
|
|
22
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['MoveSdk_' + name]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
def getExtOrIntegerDefault(name) {
|
|
26
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['MoveSdk_' + name]).toInteger()
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
android {
|
|
30
|
-
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
31
|
-
defaultConfig {
|
|
32
|
-
minSdkVersion 26
|
|
33
|
-
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
|
34
|
-
versionCode 1
|
|
35
|
-
versionName "1.0"
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
buildTypes {
|
|
39
|
-
release {
|
|
40
|
-
minifyEnabled false
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
lintOptions {
|
|
44
|
-
disable 'GradleCompatible'
|
|
45
|
-
}
|
|
46
|
-
compileOptions {
|
|
47
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
48
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
repositories {
|
|
53
|
-
|
|
54
|
-
mavenLocal()
|
|
55
|
-
mavenCentral()
|
|
56
|
-
google()
|
|
57
|
-
maven {
|
|
58
|
-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
|
|
59
|
-
url "$rootDir/../node_modules/react-native/android"
|
|
60
|
-
}
|
|
61
|
-
maven {
|
|
62
|
-
// Android JSC is installed from npm
|
|
63
|
-
url "$rootDir/../node_modules/jsc-android/dist"
|
|
64
|
-
}
|
|
65
|
-
maven {
|
|
66
|
-
url "https://dolphin.jfrog.io/artifactory/move-sdk-libs-release"
|
|
67
|
-
}
|
|
68
|
-
maven {
|
|
69
|
-
url "https://dolphin.jfrog.io/artifactory/move-sdk-libs-release"
|
|
70
|
-
}
|
|
71
|
-
def found = false
|
|
72
|
-
def defaultDir = null
|
|
73
|
-
def androidSourcesName = 'React Native sources'
|
|
74
|
-
|
|
75
|
-
if (rootProject.ext.has('reactNativeAndroidRoot')) {
|
|
76
|
-
defaultDir = rootProject.ext.get('reactNativeAndroidRoot')
|
|
77
|
-
} else {
|
|
78
|
-
defaultDir = new File(
|
|
79
|
-
projectDir,
|
|
80
|
-
'/../../../node_modules/react-native/android'
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (defaultDir.exists()) {
|
|
85
|
-
maven {
|
|
86
|
-
url defaultDir.toString()
|
|
87
|
-
name androidSourcesName
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${defaultDir.canonicalPath}")
|
|
91
|
-
found = true
|
|
92
|
-
} else {
|
|
93
|
-
def parentDir = rootProject.projectDir
|
|
94
|
-
|
|
95
|
-
1.upto(5, {
|
|
96
|
-
if (found) return true
|
|
97
|
-
parentDir = parentDir.parentFile
|
|
98
|
-
|
|
99
|
-
if (parentDir != null) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def androidSourcesDir = new File(
|
|
103
|
-
parentDir,
|
|
104
|
-
'node_modules/react-native'
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
def androidPrebuiltBinaryDir = new File(
|
|
108
|
-
parentDir,
|
|
109
|
-
'node_modules/react-native/android'
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
if (androidPrebuiltBinaryDir.exists()) {
|
|
113
|
-
maven {
|
|
114
|
-
url androidPrebuiltBinaryDir.toString()
|
|
115
|
-
name androidSourcesName
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidPrebuiltBinaryDir.canonicalPath}")
|
|
119
|
-
found = true
|
|
120
|
-
} else if (androidSourcesDir.exists()) {
|
|
121
|
-
maven {
|
|
122
|
-
url androidSourcesDir.toString()
|
|
123
|
-
name androidSourcesName
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
logger.info(":${project.name}:reactNativeAndroidRoot ${androidSourcesDir.canonicalPath}")
|
|
127
|
-
found = true
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
})
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (!found) {
|
|
134
|
-
throw new GradleException(
|
|
135
|
-
"${project.name}: unable to locate React Native android sources. " +
|
|
136
|
-
"Ensure you have you installed React Native as a dependency in your project and try again."
|
|
137
|
-
)
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
def kotlin_version = getExtOrDefault('kotlinVersion')
|
|
142
|
-
|
|
143
|
-
dependencies {
|
|
144
|
-
// noinspection GradleDynamicVersion
|
|
145
|
-
|
|
146
|
-
implementation "com.facebook.react:react-native:+"
|
|
147
|
-
api "io.dolphin.move:move-sdk:2.12.0.92"
|
|
148
|
-
|
|
149
|
-
testImplementation 'junit:junit:4.13.2'
|
|
150
|
-
testImplementation "androidx.test:core:1.4.0"
|
|
151
|
-
testImplementation 'androidx.test.ext:junit-ktx:1.1.3'
|
|
152
|
-
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0"
|
|
153
|
-
}
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
distributionBase=GRADLE_USER_HOME
|
|
2
|
-
distributionPath=wrapper/dists
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
|
4
|
-
zipStoreBase=GRADLE_USER_HOME
|
|
5
|
-
zipStorePath=wrapper/dists
|
|
6
|
-
|
|
7
|
-
android.useAndroidX=true
|
|
8
|
-
android.enableJetifier=true
|