otpless-headless-rn 1.0.1 → 1.0.2
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.
package/android/build.gradle
CHANGED
|
@@ -74,7 +74,7 @@ dependencies {
|
|
|
74
74
|
//noinspection GradleDynamicVersion
|
|
75
75
|
implementation "com.facebook.react:react-native:+"
|
|
76
76
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
-
implementation ("io.github.otpless-tech:otpless-headless-sdk:0.1.
|
|
77
|
+
implementation ("io.github.otpless-tech:otpless-headless-sdk:0.1.5")
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
if (isNewArchitectureEnabled()) {
|
|
@@ -2,6 +2,8 @@ package com.otplessheadlessrn
|
|
|
2
2
|
|
|
3
3
|
import android.app.Activity
|
|
4
4
|
import android.content.Intent
|
|
5
|
+
import androidx.appcompat.app.AppCompatActivity
|
|
6
|
+
import androidx.lifecycle.lifecycleScope
|
|
5
7
|
import com.facebook.react.bridge.ActivityEventListener
|
|
6
8
|
import com.facebook.react.bridge.Callback
|
|
7
9
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -130,8 +132,12 @@ class OtplessHeadlessRNModule(private val reactContext: ReactApplicationContext)
|
|
|
130
132
|
OtplessSDK.startAsync(request = otplessRequest, this@OtplessHeadlessRNModule::sendHeadlessEventCallback)
|
|
131
133
|
} else {
|
|
132
134
|
otplessJob?.cancel()
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
currentActivity?.let {
|
|
136
|
+
otplessJob = (it as AppCompatActivity).lifecycleScope.launch {
|
|
137
|
+
OtplessSDK.start(request = otplessRequest, this@OtplessHeadlessRNModule::sendHeadlessEventCallback)
|
|
138
|
+
}
|
|
139
|
+
} ?: run {
|
|
140
|
+
OtplessSDK.startAsync(request = otplessRequest, this@OtplessHeadlessRNModule::sendHeadlessEventCallback)
|
|
135
141
|
}
|
|
136
142
|
}
|
|
137
143
|
}
|
|
@@ -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 'OtplessBM/Core', '1.0.
|
|
20
|
+
s.dependency 'OtplessBM/Core', '1.0.6'
|
|
21
21
|
s.swift_versions = ['5.5']
|
|
22
22
|
|
|
23
23
|
# Don't install the dependencies when we run `pod install` in the old architecture.
|