otpless-headless-rn 2.0.7 → 2.0.8

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.
@@ -69,6 +69,7 @@ class OtplessHeadlessRNModule(private val reactContext: ReactApplicationContext)
69
69
 
70
70
  @ReactMethod
71
71
  fun initialize(appId: String, loginUri: String? = null) {
72
+ if (currentActivity == null) return
72
73
  (currentActivity as? AppCompatActivity)?.lifecycleScope?.let { scope ->
73
74
  scope.launch(Dispatchers.IO) {
74
75
  OtplessSDK.initialize(
@@ -92,6 +93,7 @@ class OtplessHeadlessRNModule(private val reactContext: ReactApplicationContext)
92
93
 
93
94
  @ReactMethod
94
95
  fun initTrueCaller(requestMap: ReadableMap, promise: Promise) {
96
+ if (currentActivity == null) return
95
97
  val request = parseTrueCallerRequest(requestMap)
96
98
  val scopes = parseTrueCallerScope(requestMap)
97
99
  val result = OtplessSDK.initTrueCaller(currentActivity!!, request) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "otpless-headless-rn",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "react native plugin for otpless headless android and ios",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",