@tryvital/vital-core-react-native 1.12.0 → 1.13.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 (93) hide show
  1. package/android/build/.transforms/02e4659475ffc7a86a28c4fd2eb4e342/transformed/out/jars/classes.jar +0 -0
  2. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.dex +0 -0
  3. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.dex +0 -0
  4. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.dex +0 -0
  5. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.dex +0 -0
  6. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.dex +0 -0
  7. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.dex +0 -0
  8. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.dex +0 -0
  9. package/android/build/.transforms/38d6dcf5f4478590d01d42a63c816325/transformed/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.dex +0 -0
  10. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.dex +0 -0
  11. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.dex +0 -0
  12. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.dex +0 -0
  13. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.dex +0 -0
  14. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.dex +0 -0
  15. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.dex +0 -0
  16. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModule.dex +0 -0
  17. package/android/build/.transforms/906c6adc574efcda43ab9f7ab88d85cf/transformed/release/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.dex +0 -0
  18. package/android/build/intermediates/aar_main_jar/debug/classes.jar +0 -0
  19. package/android/build/intermediates/aar_main_jar/release/classes.jar +0 -0
  20. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  21. package/android/build/intermediates/compile_library_classes_jar/release/classes.jar +0 -0
  22. package/android/build/intermediates/full_jar/release/full.jar +0 -0
  23. package/android/build/intermediates/local_aar_for_lint/release/out.aar +0 -0
  24. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  25. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  26. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  27. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  28. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  29. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  30. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  31. package/android/build/intermediates/runtime_library_classes_dir/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  32. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  33. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  34. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  35. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  36. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  37. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  38. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  39. package/android/build/intermediates/runtime_library_classes_dir/release/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  40. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  41. package/android/build/intermediates/runtime_library_classes_jar/release/classes.jar +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  50. package/android/build/kotlin/compileDebugUnitTestKotlin/cacheable/last-build.bin +0 -0
  51. package/android/build/kotlin/compileDebugUnitTestKotlin/local-state/build-history.bin +0 -0
  52. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  53. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  54. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  55. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  56. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  57. package/android/build/kotlin/compileReleaseKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  58. package/android/build/kotlin/compileReleaseKotlin/cacheable/last-build.bin +0 -0
  59. package/android/build/kotlin/compileReleaseKotlin/local-state/build-history.bin +0 -0
  60. package/android/build/kotlin/compileReleaseUnitTestKotlin/cacheable/last-build.bin +0 -0
  61. package/android/build/kotlin/compileReleaseUnitTestKotlin/local-state/build-history.bin +0 -0
  62. package/android/build/outputs/aar/tryvital_vital-core-react-native-debug.aar +0 -0
  63. package/android/build/outputs/aar/tryvital_vital-core-react-native-release.aar +0 -0
  64. package/android/build/reports/tests/testDebugUnitTest/classes/com.vitalcorereactnative.SerializationTests.html +4 -4
  65. package/android/build/reports/tests/testDebugUnitTest/index.html +4 -4
  66. package/android/build/reports/tests/testDebugUnitTest/packages/com.vitalcorereactnative.html +3 -3
  67. package/android/build/reports/tests/testReleaseUnitTest/classes/com.vitalcorereactnative.SerializationTests.html +4 -4
  68. package/android/build/reports/tests/testReleaseUnitTest/index.html +4 -4
  69. package/android/build/reports/tests/testReleaseUnitTest/packages/com.vitalcorereactnative.html +3 -3
  70. package/android/build/test-results/testDebugUnitTest/TEST-com.vitalcorereactnative.SerializationTests.xml +3 -3
  71. package/android/build/test-results/testDebugUnitTest/binary/results.bin +0 -0
  72. package/android/build/test-results/testReleaseUnitTest/TEST-com.vitalcorereactnative.SerializationTests.xml +3 -3
  73. package/android/build/test-results/testReleaseUnitTest/binary/results.bin +0 -0
  74. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  75. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  76. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  77. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  78. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  79. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  80. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  81. package/android/build/tmp/kotlin-classes/debug/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  82. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$Companion.class +0 -0
  83. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$cleanUp$1.class +0 -0
  84. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$createConnectedSourceIfNotExist$1.class +0 -0
  85. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$deregisterProvider$1.class +0 -0
  86. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$postTimeSeriesData$1.class +0 -0
  87. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule$userConnectedSources$1.class +0 -0
  88. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModule.class +0 -0
  89. package/android/build/tmp/kotlin-classes/release/com/vitalcorereactnative/VitalCoreReactNativeModuleKt.class +0 -0
  90. package/android/build.gradle +1 -1
  91. package/android/src/main/java/com/vitalcorereactnative/VitalCoreReactNativeModule.kt +17 -34
  92. package/package.json +1 -1
  93. package/vital-core-react-native.podspec +1 -1
@@ -41,7 +41,7 @@
41
41
  </td>
42
42
  <td>
43
43
  <div class="infoBox" id="duration">
44
- <div class="counter">0.187s</div>
44
+ <div class="counter">0.189s</div>
45
45
  <p>duration</p>
46
46
  </div>
47
47
  </td>
@@ -76,12 +76,12 @@
76
76
  </thead>
77
77
  <tr>
78
78
  <td class="success">canDeserializeBloodPressureSamples</td>
79
- <td class="success">0.001s</td>
79
+ <td class="success">0.002s</td>
80
80
  <td class="success">passed</td>
81
81
  </tr>
82
82
  <tr>
83
83
  <td class="success">canDeserializeGlucoseSamples</td>
84
- <td class="success">0.186s</td>
84
+ <td class="success">0.187s</td>
85
85
  <td class="success">passed</td>
86
86
  </tr>
87
87
  </table>
@@ -94,7 +94,7 @@
94
94
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
95
95
  </label>
96
96
  </div>Generated by
97
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
97
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:22</p>
98
98
  </div>
99
99
  </div>
100
100
  </body>
@@ -38,7 +38,7 @@
38
38
  </td>
39
39
  <td>
40
40
  <div class="infoBox" id="duration">
41
- <div class="counter">0.187s</div>
41
+ <div class="counter">0.189s</div>
42
42
  <p>duration</p>
43
43
  </div>
44
44
  </td>
@@ -85,7 +85,7 @@
85
85
  <td>2</td>
86
86
  <td>0</td>
87
87
  <td>0</td>
88
- <td>0.187s</td>
88
+ <td>0.189s</td>
89
89
  <td class="success">100%</td>
90
90
  </tr>
91
91
  </tbody>
@@ -112,7 +112,7 @@
112
112
  <td>2</td>
113
113
  <td>0</td>
114
114
  <td>0</td>
115
- <td>0.187s</td>
115
+ <td>0.189s</td>
116
116
  <td class="success">100%</td>
117
117
  </tr>
118
118
  </tbody>
@@ -126,7 +126,7 @@
126
126
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
127
127
  </label>
128
128
  </div>Generated by
129
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
129
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:22</p>
130
130
  </div>
131
131
  </div>
132
132
  </body>
@@ -40,7 +40,7 @@
40
40
  </td>
41
41
  <td>
42
42
  <div class="infoBox" id="duration">
43
- <div class="counter">0.187s</div>
43
+ <div class="counter">0.189s</div>
44
44
  <p>duration</p>
45
45
  </div>
46
46
  </td>
@@ -83,7 +83,7 @@
83
83
  <td>2</td>
84
84
  <td>0</td>
85
85
  <td>0</td>
86
- <td>0.187s</td>
86
+ <td>0.189s</td>
87
87
  <td class="success">100%</td>
88
88
  </tr>
89
89
  </table>
@@ -96,7 +96,7 @@
96
96
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
97
97
  </label>
98
98
  </div>Generated by
99
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
99
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:22</p>
100
100
  </div>
101
101
  </div>
102
102
  </body>
@@ -41,7 +41,7 @@
41
41
  </td>
42
42
  <td>
43
43
  <div class="infoBox" id="duration">
44
- <div class="counter">0.254s</div>
44
+ <div class="counter">0.188s</div>
45
45
  <p>duration</p>
46
46
  </div>
47
47
  </td>
@@ -76,12 +76,12 @@
76
76
  </thead>
77
77
  <tr>
78
78
  <td class="success">canDeserializeBloodPressureSamples</td>
79
- <td class="success">0.002s</td>
79
+ <td class="success">0.001s</td>
80
80
  <td class="success">passed</td>
81
81
  </tr>
82
82
  <tr>
83
83
  <td class="success">canDeserializeGlucoseSamples</td>
84
- <td class="success">0.252s</td>
84
+ <td class="success">0.187s</td>
85
85
  <td class="success">passed</td>
86
86
  </tr>
87
87
  </table>
@@ -94,7 +94,7 @@
94
94
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
95
95
  </label>
96
96
  </div>Generated by
97
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
97
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:23</p>
98
98
  </div>
99
99
  </div>
100
100
  </body>
@@ -38,7 +38,7 @@
38
38
  </td>
39
39
  <td>
40
40
  <div class="infoBox" id="duration">
41
- <div class="counter">0.254s</div>
41
+ <div class="counter">0.188s</div>
42
42
  <p>duration</p>
43
43
  </div>
44
44
  </td>
@@ -85,7 +85,7 @@
85
85
  <td>2</td>
86
86
  <td>0</td>
87
87
  <td>0</td>
88
- <td>0.254s</td>
88
+ <td>0.188s</td>
89
89
  <td class="success">100%</td>
90
90
  </tr>
91
91
  </tbody>
@@ -112,7 +112,7 @@
112
112
  <td>2</td>
113
113
  <td>0</td>
114
114
  <td>0</td>
115
- <td>0.254s</td>
115
+ <td>0.188s</td>
116
116
  <td class="success">100%</td>
117
117
  </tr>
118
118
  </tbody>
@@ -126,7 +126,7 @@
126
126
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
127
127
  </label>
128
128
  </div>Generated by
129
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
129
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:23</p>
130
130
  </div>
131
131
  </div>
132
132
  </body>
@@ -40,7 +40,7 @@
40
40
  </td>
41
41
  <td>
42
42
  <div class="infoBox" id="duration">
43
- <div class="counter">0.254s</div>
43
+ <div class="counter">0.188s</div>
44
44
  <p>duration</p>
45
45
  </div>
46
46
  </td>
@@ -83,7 +83,7 @@
83
83
  <td>2</td>
84
84
  <td>0</td>
85
85
  <td>0</td>
86
- <td>0.254s</td>
86
+ <td>0.188s</td>
87
87
  <td class="success">100%</td>
88
88
  </tr>
89
89
  </table>
@@ -96,7 +96,7 @@
96
96
  <input id="line-wrapping-toggle" type="checkbox" autocomplete="off"/>
97
97
  </label>
98
98
  </div>Generated by
99
- <a href="http://www.gradle.org">Gradle 7.5.1</a> at 8 Sept 2023, 12:03:41</p>
99
+ <a href="http://www.gradle.org">Gradle 7.5.1</a> at 4 Oct 2023, 19:02:23</p>
100
100
  </div>
101
101
  </div>
102
102
  </body>
@@ -1,8 +1,8 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <testsuite name="com.vitalcorereactnative.SerializationTests" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-09-08T11:03:40" hostname="meter.localdomain" time="0.187">
2
+ <testsuite name="com.vitalcorereactnative.SerializationTests" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-10-04T18:02:22" hostname="meter.localdomain" time="0.189">
3
3
  <properties/>
4
- <testcase name="canDeserializeGlucoseSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.186"/>
5
- <testcase name="canDeserializeBloodPressureSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.001"/>
4
+ <testcase name="canDeserializeGlucoseSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.187"/>
5
+ <testcase name="canDeserializeBloodPressureSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.002"/>
6
6
  <system-out><![CDATA[]]></system-out>
7
7
  <system-err><![CDATA[]]></system-err>
8
8
  </testsuite>
@@ -1,8 +1,8 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <testsuite name="com.vitalcorereactnative.SerializationTests" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-09-08T11:03:41" hostname="meter.localdomain" time="0.254">
2
+ <testsuite name="com.vitalcorereactnative.SerializationTests" tests="2" skipped="0" failures="0" errors="0" timestamp="2023-10-04T18:02:22" hostname="meter.localdomain" time="0.188">
3
3
  <properties/>
4
- <testcase name="canDeserializeGlucoseSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.252"/>
5
- <testcase name="canDeserializeBloodPressureSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.002"/>
4
+ <testcase name="canDeserializeGlucoseSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.187"/>
5
+ <testcase name="canDeserializeBloodPressureSamples" classname="com.vitalcorereactnative.SerializationTests" time="0.001"/>
6
6
  <system-out><![CDATA[]]></system-out>
7
7
  <system-err><![CDATA[]]></system-err>
8
8
  </testsuite>
@@ -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.21'
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,14 +96,9 @@ 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()
104
-
105
99
  mainScope.launch {
106
100
  try {
107
- val sources = client.userConnectedSources(userId)
101
+ val sources = client.userConnectedSources()
108
102
  promise.resolve(
109
103
  WritableNativeArray().apply {
110
104
  for (source in sources) {
@@ -126,10 +120,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
126
120
 
127
121
  @ReactMethod
128
122
  fun deregisterProvider(provider: String, promise: Promise) {
129
- if (!client.isConfigured)
130
- return promise.rejectCoreNotConfigured()
131
-
132
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
123
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
133
124
 
134
125
  val slug = try { ProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
135
126
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized provider slug: $provider")
@@ -150,18 +141,13 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
150
141
 
151
142
  @ReactMethod
152
143
  fun createConnectedSourceIfNotExist(provider: String, promise: Promise) {
153
- if (!client.isConfigured)
154
- return promise.rejectCoreNotConfigured()
155
-
156
- val userId = client.currentUserId ?: return promise.rejectUserIDNotSet()
157
-
158
144
  val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
159
145
  return promise.reject(VITAL_CORE_ERROR, "Unrecognized manual provider: $provider")
160
146
  }
161
147
 
162
148
  mainScope.launch {
163
149
  try {
164
- client.createConnectedSourceIfNotExist(slug, userId)
150
+ client.createConnectedSourceIfNotExist(slug)
165
151
  promise.resolve(null)
166
152
  } catch (e: Throwable) {
167
153
  promise.reject(VITAL_CORE_ERROR, "Failed to create connected source for $provider: ${e.message}", e)
@@ -172,10 +158,7 @@ class VitalCoreReactNativeModule(reactContext: ReactApplicationContext) :
172
158
  @ReactMethod
173
159
  @OptIn(ExperimentalStdlibApi::class)
174
160
  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()
161
+ val userId = VitalClient.currentUserId ?: return promise.rejectUserIDNotSet()
179
162
 
180
163
  val slug = try { ManualProviderSlug.fromJsonName(provider) } catch (e: IllegalArgumentException) {
181
164
  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.1",
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