react-native-carrot-quest 0.3.0 → 0.3.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.
|
@@ -29,8 +29,9 @@ import java.util.Locale
|
|
|
29
29
|
* that *disagree* fail with [CarrotQuestConfigurationConflictException] rather
|
|
30
30
|
* than silently keeping the first configuration.
|
|
31
31
|
*
|
|
32
|
-
* `Carrot.setup` performs I/O, so
|
|
33
|
-
*
|
|
32
|
+
* `Carrot.setup` performs I/O, so this object runs it on its own background
|
|
33
|
+
* thread. The call returns as soon as the Initializing state is published, so
|
|
34
|
+
* it is safe to call from the main thread or the JS thread.
|
|
34
35
|
*/
|
|
35
36
|
object CarrotQuestSetup {
|
|
36
37
|
private const val TAG = "CarrotQuest"
|
|
@@ -211,17 +212,21 @@ object CarrotQuestSetup {
|
|
|
211
212
|
|
|
212
213
|
val applicationContext = context.applicationContext
|
|
213
214
|
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
215
|
+
// The Initializing state above is already published, so calls that arrive
|
|
216
|
+
// before this thread runs queue as readiness waiters instead of failing.
|
|
217
|
+
Thread({
|
|
218
|
+
try {
|
|
219
|
+
start(applicationContext, options) { error ->
|
|
220
|
+
if (error == null) {
|
|
221
|
+
settleSuccess(applicationContext, identity, options)
|
|
222
|
+
} else {
|
|
223
|
+
settleFailure(error)
|
|
224
|
+
}
|
|
220
225
|
}
|
|
226
|
+
} catch (error: Throwable) {
|
|
227
|
+
settleFailure(error)
|
|
221
228
|
}
|
|
222
|
-
}
|
|
223
|
-
settleFailure(error)
|
|
224
|
-
}
|
|
229
|
+
}, "carrot-sdk-init").start()
|
|
225
230
|
}
|
|
226
231
|
|
|
227
232
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-carrot-quest",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Unofficial React Native bindings for the Carrot quest SDK, built with Nitro Modules.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|