@tryvital/vital-core-react-native 1.12.0 → 1.13.0

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 (70) hide show
  1. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.dex +0 -0
  2. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.dex +0 -0
  3. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.dex +0 -0
  4. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.dex +0 -0
  5. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.dex +0 -0
  6. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.dex +0 -0
  7. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.dex +0 -0
  8. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.dex +0 -0
  9. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  10. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  11. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  12. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  13. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  14. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  15. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  16. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  17. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  59. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  60. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  61. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  62. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  63. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  64. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  65. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  66. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  67. package/android/build.gradle +1 -1
  68. package/android/src/main/java/com/vitalcorereactnative/VitalCoreReactNativeModule.kt +17 -30
  69. package/package.json +1 -1
  70. package/vital-core-react-native.podspec +1 -1
@@ -129,7 +129,7 @@ repositories {
129
129
  }
130
130
 
131
131
  def kotlin_version = getExtOrDefault('kotlinVersion')
132
- def vital_sdk_version = '1.0.0-beta.18'
132
+ def vital_sdk_version = '1.0.0-beta.20'
133
133
 
134
134
  dependencies {
135
135
  //noinspection GradleDynamicVersion
@@ -48,11 +48,12 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
48
48
 
49
49
  @ReactMethod
50
50
  fun setUserId(userId: String, promise: Promise) {
51
- if (!client.isConfigured)
52
- return promise.rejectCoreNotConfigured()
53
-
54
- client.setUserId(userId)
55
- promise.resolve(null)
51
+ try {
52
+ VitalClient.setUserId(reactApplicationContext, userId)
53
+ promise.resolve(null)
54
+ } catch (e: Throwable) {
55
+ promise.reject(VITAL_CORE_ERROR, e.message, e)
56
+ }
56
57
  }
57
58
 
58
59
  @ReactMethod
@@ -67,27 +68,25 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
67
68
  )
68
69
 
69
70
  promise.resolve(null)
70
- } catch (e: IllegalArgumentException) {
71
+ } catch (e: Throwable) {
71
72
  promise.reject(VITAL_CORE_ERROR, e.message, e)
72
73
  }
73
74
  }
74
75
 
75
76
  @ReactMethod
76
77
  fun cleanUp(promise: Promise) {
77
- if (!client.isConfigured)
78
- return promise.rejectCoreNotConfigured()
79
-
80
78
  mainScope.launch {
81
- client.cleanUp()
82
- promise.resolve(null)
79
+ try {
80
+ client.cleanUp()
81
+ promise.resolve(null)
82
+ } catch (e: Throwable) {
83
+ promise.reject(VITAL_CORE_ERROR, e.message, e)
84
+ }
83
85
  }
84
86
  }
85
87
 
86
88
  @ReactMethod
87
89
  fun hasUserConnectedTo(provider: String, promise: Promise) {
88
- if (!client.isConfigured)
89
- return promise.rejectCoreNotConfigured()
90
-
91
90
  val slug = try { ProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
92
91
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized provider slug: $provider")
93
92
  }
@@ -97,10 +96,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
97
96
 
98
97
  @ReactMethod
99
98
  fun userConnectedSources(promise: Promise) {
100
- if (!client.isConfigured)
101
- return promise.rejectCoreNotConfigured()
102
-
103
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
99
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
104
100
 
105
101
  mainScope.launch {
106
102
  try {
@@ -126,10 +122,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
126
122
 
127
123
  @ReactMethod
128
124
  fun deregisterProvider(provider: String, promise: Promise) {
129
- if (!client.isConfigured)
130
- return promise.rejectCoreNotConfigured()
131
-
132
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
125
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
133
126
 
134
127
  val slug = try { ProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
135
128
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized provider slug: $provider")
@@ -150,10 +143,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
150
143
 
151
144
  @ReactMethod
152
145
  fun createConnectedSourceIfNotExist(provider: String, promise: Promise) {
153
- if (!client.isConfigured)
154
- return promise.rejectCoreNotConfigured()
155
-
156
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
146
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
157
147
 
158
148
  val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
159
149
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized manual provider: $provider")
@@ -172,10 +162,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
172
162
  @ReactMethod
173
163
  @OptIn(ExperimentalStdlibApi::class)
174
164
  fun postTimeSeriesData(jsonString: String, provider: String, timeZoneString: String?, promise: Promise) {
175
- if (!client.isConfigured)
176
- return promise.rejectCoreNotConfigured()
177
-
178
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
165
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
179
166
 
180
167
  val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
181
168
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized manual provider: $provider")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvital/vital-core-react-native",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "test",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -17,7 +17,7 @@ Pod::Spec.new do |s|
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
18
 
19
19
  s.dependency "React-Core"
20
- s.dependency "VitalCore", "~> 0.10.1"
20
+ s.dependency "VitalCore", "~> 0.10.6"
21
21
 
22
22
  # Don't install the dependencies when we run `pod install` in the old architecture.
23
23
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then