react-native-move-sdk 2.13.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.
Files changed (89) hide show
  1. package/android/build.gradle.kts +42 -0
  2. package/android/gradle.properties +16 -6
  3. package/android/settings.gradle.kts +35 -0
  4. package/android/src/{main/java/in/dolph/move/sdk → legacy}/MoveSdkModule.kt +30 -195
  5. package/android/src/main/AndroidManifest.xml +1 -11
  6. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/DeviceScanner.kt +19 -21
  7. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/Mapper.kt +3 -2
  8. package/android/src/main/java/com/movesdk/MoveExtensions.kt +188 -0
  9. package/android/src/main/java/{in/dolph/move/sdk/MoveSdkRepository.kt → com/movesdk/MoveSdkConfigRepository.kt} +3 -1
  10. package/android/src/main/java/com/movesdk/MoveSdkPackage.kt +32 -0
  11. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/NativeMoveSdkWrapper.kt +201 -61
  12. package/android/src/main/java/com/movesdk/extentions/ConnectionExt.kt +52 -0
  13. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/extentions/PermissionUtils.kt +1 -1
  14. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/extentions/SharedPreferencesExt.kt +1 -1
  15. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/metadata/MetadataStorage.kt +1 -1
  16. package/android/src/main/java/{in/dolph/move/sdk → com/movesdk}/metadata/MetadataStorageImpl.kt +2 -2
  17. package/android/src/main/java/com/movesdk/shared/Constants.kt +39 -0
  18. package/android/src/turbo/MoveSdkModule.kt +422 -0
  19. package/ios/MoveSdk.h +13 -0
  20. package/ios/MoveSdk.mm +717 -0
  21. package/ios/MoveSdk.swift +1022 -0
  22. package/ios/{NativeModule/MoveSdkDeviceScanner.swift → MoveSdkDeviceScanner.swift} +1 -1
  23. package/lib/commonjs/NativeMoveSdk.js +21 -0
  24. package/lib/commonjs/NativeMoveSdk.js.map +1 -0
  25. package/lib/commonjs/components/LazyMoveSdk.js +22 -41
  26. package/lib/commonjs/components/LazyMoveSdk.js.map +1 -1
  27. package/lib/commonjs/index.js +331 -25
  28. package/lib/commonjs/index.js.map +1 -1
  29. package/lib/commonjs/package.json +1 -0
  30. package/lib/module/NativeMoveSdk.js +17 -0
  31. package/lib/module/NativeMoveSdk.js.map +1 -0
  32. package/lib/module/components/LazyMoveSdk.js +15 -20
  33. package/lib/module/components/LazyMoveSdk.js.map +1 -1
  34. package/lib/module/index.js +337 -3
  35. package/lib/module/index.js.map +1 -1
  36. package/lib/module/package.json +1 -0
  37. package/lib/typescript/commonjs/example/src/App.d.ts +2 -0
  38. package/lib/typescript/commonjs/example/src/App.d.ts.map +1 -0
  39. package/lib/typescript/commonjs/package.json +1 -0
  40. package/lib/typescript/commonjs/src/NativeMoveSdk.d.ts +133 -0
  41. package/lib/typescript/commonjs/src/NativeMoveSdk.d.ts.map +1 -0
  42. package/lib/typescript/{components → commonjs/src/components}/LazyMoveSdk.d.ts +2 -1
  43. package/lib/typescript/commonjs/src/components/LazyMoveSdk.d.ts.map +1 -0
  44. package/lib/typescript/commonjs/src/index.d.ts +84 -0
  45. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  46. package/lib/typescript/module/example/src/App.d.ts +2 -0
  47. package/lib/typescript/module/example/src/App.d.ts.map +1 -0
  48. package/lib/typescript/module/package.json +1 -0
  49. package/lib/typescript/module/src/NativeMoveSdk.d.ts +133 -0
  50. package/lib/typescript/module/src/NativeMoveSdk.d.ts.map +1 -0
  51. package/lib/typescript/module/src/components/LazyMoveSdk.d.ts +8 -0
  52. package/lib/typescript/module/src/components/LazyMoveSdk.d.ts.map +1 -0
  53. package/lib/typescript/module/src/index.d.ts +84 -0
  54. package/lib/typescript/module/src/index.d.ts.map +1 -0
  55. package/package.json +197 -138
  56. package/react-native-move-sdk.podspec +30 -9
  57. package/src/NativeMoveSdk.ts +227 -0
  58. package/src/components/LazyMoveSdk.tsx +2 -2
  59. package/src/{MoveSdk.ts → index.tsx} +131 -199
  60. package/android/.project +0 -17
  61. package/android/build.gradle +0 -153
  62. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  63. package/android/gradle/wrapper/gradle-wrapper.properties +0 -8
  64. package/android/gradlew +0 -183
  65. package/android/gradlew.bat +0 -100
  66. package/android/src/main/java/in/dolph/move/sdk/MoveExtensions.kt +0 -72
  67. package/android/src/main/java/in/dolph/move/sdk/MoveSdkPackage.kt +0 -19
  68. package/android/src/main/java/in/dolph/move/sdk/WrapperBtConnectionsReceiver.kt +0 -99
  69. package/android/src/main/res/drawable-anydpi-v24/ic_notification.xml +0 -13
  70. package/android/src/main/res/drawable-hdpi/ic_notification.png +0 -0
  71. package/android/src/main/res/drawable-mdpi/ic_notification.png +0 -0
  72. package/android/src/main/res/drawable-xhdpi/ic_notification.png +0 -0
  73. package/android/src/main/res/drawable-xxhdpi/ic_notification.png +0 -0
  74. package/android/src/main/res/values/strings.xml +0 -9
  75. package/android/src/main/strings.xml +0 -0
  76. package/android/src/test/java/io/dolphin/move/MoveWrapperTest.kt +0 -190
  77. package/ios/MoveSdk-Bridging-Header.h +0 -3
  78. package/ios/MoveSdk.xcodeproj/project.pbxproj +0 -287
  79. package/ios/MoveSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
  80. package/ios/MoveSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  81. package/ios/NativeModule/MoveSdk.h +0 -144
  82. package/ios/NativeModule/MoveSdk.swift +0 -1359
  83. package/lib/commonjs/MoveSdk.js +0 -443
  84. package/lib/commonjs/MoveSdk.js.map +0 -1
  85. package/lib/module/MoveSdk.js +0 -432
  86. package/lib/module/MoveSdk.js.map +0 -1
  87. package/lib/typescript/MoveSdk.d.ts +0 -158
  88. package/lib/typescript/index.d.ts +0 -3
  89. package/src/index.ts +0 -3
package/package.json CHANGED
@@ -1,138 +1,197 @@
1
- {
2
- "name": "react-native-move-sdk",
3
- "version": "2.13.0",
4
- "description": "React Native library for MOVE SDK",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
10
- "files": [
11
- "src",
12
- "lib",
13
- "android",
14
- "ios",
15
- "react-native-move-sdk.podspec",
16
- "!lib/typescript/example",
17
- "!android/build",
18
- "!ios/build",
19
- "!**/__tests__",
20
- "!**/__fixtures__",
21
- "!**/__mocks__"
22
- ],
23
- "scripts": {
24
- "typescript": "tsc --noEmit",
25
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
26
- "prepare": "bob build",
27
- "release": "release-it",
28
- "bootstrap": "yarn"
29
- },
30
- "keywords": [
31
- "react-native",
32
- "ios",
33
- "android"
34
- ],
35
- "repository": "https://www.dolph.in",
36
- "author": "Dolphin Technologies <info@dolph.in> (https://www.dolph.in)",
37
- "license": "MIT",
38
- "bugs": {
39
- "url": "https://www.dolph.in"
40
- },
41
- "homepage": "https://www.dolph.in",
42
- "publishConfig": {
43
- "registry": "https://registry.npmjs.org/"
44
- },
45
- "devDependencies": {
46
- "@commitlint/config-conventional": "^11.0.0",
47
- "@react-native-community/eslint-config": "^2.0.0",
48
- "@release-it/conventional-changelog": "^2.0.0",
49
- "@types/react": "^18.2.48",
50
- "@types/react-native": "^0.73.0",
51
- "commitlint": "^11.0.0",
52
- "eslint": "^8.57.0",
53
- "eslint-config-prettier": "^7.0.0",
54
- "eslint-plugin-prettier": "^3.1.3",
55
- "flow-remove-types": "^2.177.0",
56
- "pod-install": "^0.1.0",
57
- "prettier": "^2.0.5",
58
- "react": "^18.2.0",
59
- "react-native": "^0.73.2",
60
- "react-native-builder-bob": "^0.17.1",
61
- "release-it": "^14.2.2",
62
- "typescript": "^5.3.3"
63
- },
64
- "peerDependencies": {
65
- "react": "*",
66
- "react-native": "*"
67
- },
68
- "commitlint": {
69
- "extends": [
70
- "@commitlint/config-conventional"
71
- ]
72
- },
73
- "release-it": {
74
- "git": {
75
- "commitMessage": "chore: release ${version}",
76
- "tagName": "v${version}"
77
- },
78
- "npm": {
79
- "publish": true
80
- },
81
- "github": {
82
- "release": true
83
- },
84
- "plugins": {
85
- "@release-it/conventional-changelog": {
86
- "preset": "angular"
87
- }
88
- }
89
- },
90
- "eslintConfig": {
91
- "root": true,
92
- "extends": [
93
- "@react-native-community",
94
- "prettier"
95
- ],
96
- "rules": {
97
- "prettier/prettier": [
98
- "error",
99
- {
100
- "quoteProps": "consistent",
101
- "singleQuote": true,
102
- "tabWidth": 2,
103
- "trailingComma": "es5",
104
- "useTabs": false
105
- }
106
- ]
107
- }
108
- },
109
- "eslintIgnore": [
110
- "node_modules/",
111
- "lib/"
112
- ],
113
- "prettier": {
114
- "quoteProps": "consistent",
115
- "singleQuote": true,
116
- "tabWidth": 2,
117
- "trailingComma": "es5",
118
- "useTabs": false,
119
- "printWidth": 200
120
- },
121
- "react-native-builder-bob": {
122
- "source": "src",
123
- "output": "lib",
124
- "targets": [
125
- "commonjs",
126
- "module",
127
- [
128
- "typescript",
129
- {
130
- "project": "tsconfig.build.json"
131
- }
132
- ]
133
- ]
134
- },
135
- "dependencies": {
136
- "@react-native-async-storage/async-storage": "^1.21.0"
137
- }
138
- }
1
+ {
2
+ "name": "react-native-move-sdk",
3
+ "version": "2.14.0-1",
4
+ "description": "React Native library for MOVE SDK",
5
+ "source": "./src/index.tsx",
6
+ "main": "./lib/commonjs/index.js",
7
+ "module": "./lib/module/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "source": "./src/index.tsx",
11
+ "import": {
12
+ "types": "./lib/typescript/module/src/index.d.ts",
13
+ "default": "./lib/module/index.js"
14
+ },
15
+ "require": {
16
+ "types": "./lib/typescript/commonjs/src/index.d.ts",
17
+ "default": "./lib/commonjs/index.js"
18
+ }
19
+ },
20
+ "./package.json": "./package.json"
21
+ },
22
+ "files": [
23
+ "src",
24
+ "lib",
25
+ "android",
26
+ "ios",
27
+ "cpp",
28
+ "*.podspec",
29
+ "!ios/build",
30
+ "!android/build",
31
+ "!android/gradle",
32
+ "!android/gradlew",
33
+ "!android/gradlew.bat",
34
+ "!android/local.properties",
35
+ "!**/__tests__",
36
+ "!**/__fixtures__",
37
+ "!**/__mocks__",
38
+ "!**/.*"
39
+ ],
40
+ "scripts": {
41
+ "example": "yarn workspace react-native-move-sdk-example",
42
+ "test": "jest",
43
+ "typecheck": "tsc",
44
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
45
+ "clean": "del-cli node_modules android/generated ios/generated android/build example/android/build example/android/app/build example/ios/build",
46
+ "prepare": "bob build",
47
+ "release": "release-it"
48
+ },
49
+ "keywords": [
50
+ "react-native",
51
+ "ios",
52
+ "android"
53
+ ],
54
+ "repository": "https://dolph.in.git",
55
+ "author": "Dolphin Technologies GmbH <info@dolph.in> (https://dolph.in)",
56
+ "license": "MIT",
57
+ "bugs": {
58
+ "url": "https://dolph.in"
59
+ },
60
+ "homepage": "https://dolph.in",
61
+ "publishConfig": {
62
+ "registry": "https://registry.npmjs.org/"
63
+ },
64
+ "devDependencies": {
65
+ "@commitlint/config-conventional": "^17.0.2",
66
+ "@evilmartians/lefthook": "^1.5.0",
67
+ "@react-native/eslint-config": "^0.73.1",
68
+ "@release-it/conventional-changelog": "^5.0.0",
69
+ "@types/jest": "^29.5.5",
70
+ "@types/react": "~18.3.12",
71
+ "@yarnpkg/doctor": "^4.0.4",
72
+ "commitlint": "^17.0.2",
73
+ "del-cli": "^5.1.0",
74
+ "eslint": "^8.51.0",
75
+ "eslint-config-prettier": "^9.0.0",
76
+ "eslint-plugin-prettier": "^5.0.1",
77
+ "jest": "^29.7.0",
78
+ "prettier": "^3.0.3",
79
+ "react": "18.3.1",
80
+ "react-native": "0.76.9",
81
+ "react-native-builder-bob": "^0.40.12",
82
+ "release-it": "^15.0.0",
83
+ "turbo": "^1.10.7",
84
+ "typescript": "^5.2.2"
85
+ },
86
+ "resolutions": {
87
+ "@types/react": "^18.2.44"
88
+ },
89
+ "peerDependencies": {
90
+ "react": "*",
91
+ "react-native": "*"
92
+ },
93
+ "workspaces": [
94
+ "example"
95
+ ],
96
+ "packageManager": "yarn@4.9.2+sha512.1fc009bc09d13cfd0e19efa44cbfc2b9cf6ca61482725eb35bbc5e257e093ebf4130db6dfe15d604ff4b79efd8e1e8e99b25fa7d0a6197c9f9826358d4d65c3c",
97
+ "jest": {
98
+ "preset": "react-native",
99
+ "modulePathIgnorePatterns": [
100
+ "<rootDir>/example/node_modules",
101
+ "<rootDir>/lib/"
102
+ ]
103
+ },
104
+ "commitlint": {
105
+ "extends": [
106
+ "@commitlint/config-conventional"
107
+ ]
108
+ },
109
+ "release-it": {
110
+ "git": {
111
+ "commitMessage": "chore: release ${version}",
112
+ "tagName": "v${version}"
113
+ },
114
+ "npm": {
115
+ "publish": true
116
+ },
117
+ "github": {
118
+ "release": true
119
+ },
120
+ "plugins": {
121
+ "@release-it/conventional-changelog": {
122
+ "preset": "angular"
123
+ }
124
+ }
125
+ },
126
+ "eslintConfig": {
127
+ "root": true,
128
+ "extends": [
129
+ "@react-native",
130
+ "prettier"
131
+ ],
132
+ "rules": {
133
+ "react/react-in-jsx-scope": "off",
134
+ "prettier/prettier": [
135
+ "error",
136
+ {
137
+ "quoteProps": "consistent",
138
+ "singleQuote": true,
139
+ "tabWidth": 2,
140
+ "trailingComma": "es5",
141
+ "useTabs": false
142
+ }
143
+ ]
144
+ }
145
+ },
146
+ "eslintIgnore": [
147
+ "node_modules/",
148
+ "lib/"
149
+ ],
150
+ "prettier": {
151
+ "quoteProps": "consistent",
152
+ "singleQuote": true,
153
+ "tabWidth": 2,
154
+ "trailingComma": "es5",
155
+ "useTabs": false
156
+ },
157
+ "react-native-builder-bob": {
158
+ "source": "src",
159
+ "output": "lib",
160
+ "targets": [
161
+ [
162
+ "module",
163
+ {
164
+ "esm": true
165
+ }
166
+ ],
167
+ [
168
+ "commonjs",
169
+ {
170
+ "esm": true
171
+ }
172
+ ],
173
+ "typescript"
174
+ ]
175
+ },
176
+ "dependencies": {
177
+ "@react-native-async-storage/async-storage": "^1.21.0"
178
+ },
179
+ "codegenConfig": {
180
+ "name": "RNMoveSdkSpec",
181
+ "type": "all",
182
+ "jsSrcsDir": "src",
183
+ "outputDir": {
184
+ "ios": "ios/generated",
185
+ "android": "android/generated"
186
+ },
187
+ "android": {
188
+ "javaPackageName": "com.movesdk"
189
+ }
190
+ },
191
+ "create-react-native-library": {
192
+ "type": "module-mixed",
193
+ "languages": "kotlin-objc",
194
+ "version": "0.41.2"
195
+ },
196
+ "types": "./lib/typescript/commonjs/src/index.d.ts"
197
+ }
@@ -1,10 +1,9 @@
1
- require 'json'
1
+ require "json"
2
2
 
3
- package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+ folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'
4
5
 
5
6
  Pod::Spec.new do |s|
6
- s.module_name = "ReactMoveSDK"
7
- s.header_dir = "ReactMoveSDK"
8
7
  s.name = "react-native-move-sdk"
9
8
  s.version = package["version"]
10
9
  s.summary = package["description"]
@@ -12,11 +11,33 @@ Pod::Spec.new do |s|
12
11
  s.license = package["license"]
13
12
  s.authors = package["author"]
14
13
 
15
- s.platforms = { :ios => "13.0" }
14
+ s.platforms = { :ios => min_ios_version_supported }
15
+ s.source = { :git => "https://dolph.in.git", :tag => "#{s.version}" }
16
16
 
17
- s.source = { :git => "https://github.com/***", :tag=> "v#{s.version}" }
18
- s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+ s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
19
18
 
20
- s.dependency 'React'
21
- s.dependency 'DolphinMoveSDK', '2.13.0.315'
19
+ s.dependency 'DolphinMoveSDK', '2.14.0.316'
20
+
21
+ # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
22
+ # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
23
+ if respond_to?(:install_modules_dependencies, true)
24
+ install_modules_dependencies(s)
25
+ else
26
+ s.dependency "React-Core"
27
+
28
+ # Don't install the dependencies when we run `pod install` in the old architecture.
29
+ if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
30
+ s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
31
+ s.pod_target_xcconfig = {
32
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
33
+ "OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
34
+ "CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
35
+ }
36
+ s.dependency "React-Codegen"
37
+ s.dependency "RCT-Folly"
38
+ s.dependency "RCTRequired"
39
+ s.dependency "RCTTypeSafety"
40
+ s.dependency "ReactCommon/turbomodule/core"
41
+ end
42
+ end
22
43
  end
@@ -0,0 +1,227 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ export type AuthState = 'UNKNOWN' | 'VALID' | 'EXPIRED' | 'INVALID';
5
+ export type DrivingService = 'DISTRACTION_FREE_DRIVING' | 'DRIVING_BEHAVIOUR' | 'DEVICE_DISCOVERY';
6
+ export type WalkingService = 'WALKING_LOCATION';
7
+ export type TimelineDetectionService = 'DRIVING' | 'CYCLING' | 'WALKING' | 'PLACES' | 'PUBLIC_TRANSPORT' | 'AUTOMATIC_IMPACT_DETECTION' | 'ASSISTANCE_CALL' | 'POINTS_OF_INTEREST' | 'HEALTH';
8
+ export type ErrorReasons =
9
+ | 'BACKGROUND_LOCATION_PERMISSION_MISSING'
10
+ | 'LOCATION_PERMISSION_MISSING'
11
+ | 'MOTION_PERMISSION_MISSING'
12
+ | 'ACTIVITY_PERMISSION_MISSING'
13
+ | 'BATTERY_PERMISSION_MISSING'
14
+ | 'UNAUTHORIZED'
15
+ | 'INTERNET_PERMISSION_MISSING'
16
+ | 'PHONE_PERMISSION_MISSING'
17
+ | 'OVERLAY_PERMISSION_MISSING'
18
+ | 'NOTIFICATION_MISSING'
19
+ | 'ACCELEROMETER_MISSING'
20
+ | 'GOOGLE_PLAY_LOCATION_ACCURACY_MISSING'
21
+ | 'PRECISE_LOCATION_PERMISSION_MISSING';
22
+
23
+ export type WarningReasons =
24
+ | 'BACKGROUND_LOCATION_PERMISSION_MISSING'
25
+ | 'MOTION_PERMISSION_MISSING'
26
+ | 'ACTIVITY_PERMISSION_MISSING'
27
+ | 'BATTERY_OPTIMIZATION'
28
+ | 'BLUETOOTH_TURNED_OFF'
29
+ | 'BLUETOOTH_SCAN_PERMISSION_MISSING'
30
+ | 'BLUETOOTH_CONNECT_PERMISSION_MISSING'
31
+ | 'GOOGLE_PLAY_LOCATION_ACCURACY_MISSING'
32
+ | 'NOTIFICATION_PERMISSION_MISSING'
33
+ | 'FINE_LOCATION_PERMISSION_MISSING'
34
+ | 'BLUETOOTH_PERMISSION_MISSING'
35
+ | 'GPS_OFF'
36
+ | 'OFFLINE'
37
+ | 'GO_EDITION'
38
+ | 'ROOTED'
39
+ | 'NO_SIM'
40
+ | 'BACKGROUND_RESTRICTED'
41
+ | 'MOCK_PROVIDER_LOCATION'
42
+ | 'MOCK_PROVIDER'
43
+ | 'LOCATION_MODE'
44
+ | 'PLAY_SERVICES_MISSING'
45
+ | 'LOCATION_POWER_MODE(0)'
46
+ | 'LOCATION_POWER_MODE(1)'
47
+ | 'LOCATION_POWER_MODE(2)'
48
+ | 'LOCATION_POWER_MODE(3)'
49
+ | 'LOCATION_POWER_MODE(4)'
50
+ | 'ENERGY_SAVER';
51
+ export type IssueListService = TimelineDetectionService | DrivingService | WalkingService;
52
+ export type ErrorListType = Array<IssueListItem<ErrorReasons>>;
53
+ export type WarningListType = Array<IssueListItem<WarningReasons>>;
54
+ export type ShutdownReturnType = 'NETWORK_ERROR' | 'SUCCESS' | 'UNINITIALIZED';
55
+ export type MoveSdkDeviceFilter = 'beacon' | 'paired'| 'connected';
56
+ export type SdkState = 'UNINITIALIZED' | 'READY' | 'RUNNING';
57
+ export type TripState = 'UNKNOWN' | 'DRIVING' | 'HALT' | 'IDLE' | 'IGNORED';
58
+ export type HealthReasons = | 'BATTERY_LEVEL' | 'CPU_USAGE' | 'DISK_USAGE' | 'INTERNET_USAGE' | 'MEMORY_USAGE' | 'NEW_VERSION' | 'UNIMPLEMENTED_LISTENERS';
59
+
60
+ export interface IssueListItem<ReasonsType> {
61
+ reasons: Array<ReasonsType>;
62
+ service?: IssueListService;
63
+ };
64
+ export interface MoveSdkConfig {
65
+ timelineDetectionServices: Array<TimelineDetectionService>;
66
+ drivingServices: Array<DrivingService>;
67
+ walkingServices: Array<WalkingService>;
68
+ };
69
+ export interface MoveSdkDeviceDiscovery {
70
+ startDelay?: number;
71
+ duration?: number;
72
+ interval?: number;
73
+ stopScanOnFirstDiscovered?: boolean;
74
+ };
75
+ export interface MoveSdkOptions {
76
+ motionPermissionMandatory?: boolean;
77
+ backgroundLocationPermissionMandatory?: boolean;
78
+ overlayPermissionMandatory?: boolean;
79
+ useBackendConfig?: boolean;
80
+ deviceDiscovery?: MoveSdkDeviceDiscovery;
81
+ };
82
+ export interface MoveSdkAuth {
83
+ userId: string;
84
+ accessToken: string;
85
+ refreshToken: string;
86
+ projectId: number;
87
+ };
88
+ export interface NotificationConfig {
89
+ title: string;
90
+ text: string;
91
+ };
92
+ export interface MoveSdkAndroidConfig {
93
+ notifications: {
94
+ recognitionNotification: NotificationConfig;
95
+ tripNotification: NotificationConfig;
96
+ };
97
+ };
98
+ export interface AuthStateEvent {
99
+ state: AuthState;
100
+ accessToken?: string;
101
+ refreshToken?: string;
102
+ };
103
+ export interface MoveSdkDevice {
104
+ name: string;
105
+ data: string;
106
+ id: string;
107
+ isConnected?: boolean;
108
+ };
109
+ export interface MoveScanResult {
110
+ isDiscovered: boolean;
111
+ device: MoveSdkDevice;
112
+ name: string;
113
+ };
114
+ export interface MoveSdkLog {
115
+ message: string;
116
+ value?: string;
117
+ };
118
+ export interface HealthListItem {
119
+ reason: HealthReasons;
120
+ description: string;
121
+ };
122
+
123
+ export interface Spec extends TurboModule {
124
+
125
+ addListener: (eventType: string) => void;
126
+ removeListeners: (count: number) => void;
127
+
128
+ cancelTimer(key: string): void;
129
+
130
+ canDrawOverlays(): Promise<boolean>;
131
+
132
+ finishCurrentTrip(): void;
133
+
134
+ forceTripRecognition(duration: number): void;
135
+
136
+ getAuthState(): Promise<AuthState>;
137
+
138
+ getBluetoothPermission(): Promise<boolean>;
139
+
140
+ getBluetoothState(): Promise<boolean>;
141
+
142
+ getDeviceQualifier(): Promise<string>;
143
+
144
+ getErrors(): Promise<ErrorListType>;
145
+
146
+ geocode(latitude: number, longitude: number): Promise<string>;
147
+
148
+ getRegisteredDevices(): Promise<Array<MoveSdkDevice>>;
149
+
150
+ getState(): Promise<SdkState>;
151
+
152
+ getTripState(): Promise<TripState>;
153
+
154
+ getWarnings(): Promise<WarningListType>;
155
+
156
+ ignoreCurrentTrip(): void;
157
+
158
+ initiateAssistanceCall(): Promise<boolean>;
159
+
160
+ isAppIgnoringBatteryOptimization(): Promise<boolean>;
161
+
162
+ requestAppIgnoringBatteryOptimization(): void;
163
+
164
+ isAuthValid(): Promise<boolean>;
165
+
166
+ keepActive(enabled: boolean): void;
167
+
168
+ keepInForeground(enabled: boolean): void;
169
+
170
+ mockLocations(allow: boolean): void;
171
+
172
+ registerDevices(devices: Array<MoveSdkDevice>): Promise<boolean>;
173
+
174
+ requestBluetoothAlwaysUsagePermission(): void;
175
+
176
+ requestDrawOverlaysPermission(): void;
177
+
178
+ requestMotionPermission(): void;
179
+
180
+ resolveError(): void;
181
+
182
+ setAssistanceMetaData(data: string): void;
183
+
184
+ setLiveLocationTag(tag?: string): Promise<boolean>;
185
+
186
+ setTimer(callback: () => void, delay: number): void;
187
+
188
+ setTripMetadata(metadata?: {[key: string]: string}): void;
189
+
190
+ setup(auth: MoveSdkAuth,
191
+ config: MoveSdkConfig,
192
+ options?: MoveSdkOptions,
193
+ platformParams?: Array<string>): Promise<void>;
194
+
195
+ setupWithCode(code: string,
196
+ config: MoveSdkConfig,
197
+ options?: MoveSdkOptions,
198
+ platformParams?: Array<string>): Promise<void>;
199
+
200
+ shutdown(force: boolean): Promise<ShutdownReturnType>;
201
+
202
+ startAutomaticDetection(): Promise<boolean>;
203
+
204
+ startNativeSdkStateListener(): void;
205
+
206
+ startScanningDevices(filter: Array<MoveSdkDeviceFilter>, uuid?: string, manufacturerId?: number): void;
207
+
208
+ startTrip(metadata?: { [key: string]: string }): Promise<boolean>;
209
+
210
+ stopAutomaticDetection(): Promise<boolean>;
211
+
212
+ stopScanningDevices(): void;
213
+
214
+ synchronizeUserData(): Promise<boolean>;
215
+
216
+ unregisterDevices(devices: Array<MoveSdkDevice>): Promise<boolean>;
217
+
218
+ updateAuth(auth: MoveSdkAuth): Promise<void>;
219
+
220
+ updateConfig(config: MoveSdkConfig, options?: MoveSdkOptions): void;
221
+
222
+ requestHealthPermissions(): Promise<boolean>;
223
+ }
224
+
225
+
226
+
227
+ export default TurboModuleRegistry.getEnforcing<Spec>('MoveSdk');
@@ -1,8 +1,8 @@
1
1
  import React, { Suspense, useEffect, useRef, useState } from 'react';
2
- import { AppState, AppStateStatus, Platform, View } from 'react-native';
2
+ import { AppState, type AppStateStatus, Platform, View } from 'react-native';
3
3
  import AsyncStorage from '@react-native-async-storage/async-storage';
4
4
 
5
- import MoveSdk, { SdkState, TripState } from '../MoveSdk';
5
+ import MoveSdk, { type SdkState, type TripState } from '../index';
6
6
 
7
7
  type LazyMoveSdkProps = {
8
8
  children: React.ReactNode;