@doorstepai/dropoff-sdk 2.2.4 → 2.2.6

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.
@@ -90,7 +90,7 @@ dependencies {
90
90
  // `onRequestPermissionsResult` to `DoorstepAI.notePermissionRequestResult(...)`
91
91
  // (the only way the SDK can tell a re-askable denial from a permanent one), so
92
92
  // the SDK's types have to be on the host's compile classpath.
93
- api("ai.doorstep.com:doorstepai-dropoff-sdk:2.2.3")
93
+ api("ai.doorstep.com:doorstepai-dropoff-sdk:2.2.9")
94
94
  api "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1"
95
95
  }
96
96
 
@@ -498,7 +498,7 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
498
498
  * signal a refusal reports as the re-askable DENIED instead of
499
499
  * PERMANENTLY_DENIED.
500
500
  */
501
- private fun permissionContext() = currentActivity ?: reactContext
501
+ private fun permissionContext() = reactContext.currentActivity ?: reactContext
502
502
 
503
503
  @ReactMethod
504
504
  fun checkPermissions(permissions: ReadableArray?, promise: Promise) {
@@ -567,7 +567,7 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
567
567
  PERMISSION_ANSWER_TIMEOUT_MS
568
568
  }
569
569
 
570
- val activity = currentActivity
570
+ val activity = reactContext.currentActivity
571
571
  if (activity == null) {
572
572
  promise.reject("NO_ACTIVITY", "requestPermissions needs a resumed Activity to prompt from")
573
573
  return
@@ -773,7 +773,7 @@ class DoorstepAIModule(private val reactContext: ReactApplicationContext) :
773
773
 
774
774
  @ReactMethod
775
775
  fun requestBackgroundLocationPermission(promise: Promise) {
776
- val activity = currentActivity
776
+ val activity = reactContext.currentActivity
777
777
  if (activity == null) {
778
778
  promise.reject("NO_ACTIVITY", "requestBackgroundLocationPermission needs a resumed Activity to prompt from")
779
779
  return
@@ -50,9 +50,9 @@ class DoorstepEmbedViewManager : SimpleViewManager<DoorstepEmbedView>() {
50
50
  putString("mode", mode.value)
51
51
  })
52
52
  }
53
- view.onError = { message ->
53
+ view.onError = { error ->
54
54
  emit(view, ERROR_EVENT, Arguments.createMap().apply {
55
- putString("message", message)
55
+ putString("message", error.message)
56
56
  })
57
57
  }
58
58
  return view
@@ -176,4 +176,3 @@ class DoorstepEmbedViewManager : SimpleViewManager<DoorstepEmbedView>() {
176
176
  const val DEFAULT_EXPANDED_HEIGHT = 600f
177
177
  }
178
178
  }
179
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doorstepai/dropoff-sdk",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "doorstep.ai dropoff sdk for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",