react-native-authsignal 1.5.0-alpha2 → 1.5.0
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
|
@@ -5,7 +5,7 @@ import com.authsignal.models.AuthsignalResponse
|
|
|
5
5
|
import com.authsignal.models.ChallengeResponse
|
|
6
6
|
import com.authsignal.models.EnrollResponse
|
|
7
7
|
import com.authsignal.models.VerifyResponse
|
|
8
|
-
import com.authsignal.whatsapp.
|
|
8
|
+
import com.authsignal.whatsapp.AuthsignalWhatsApp
|
|
9
9
|
import com.facebook.react.bridge.Arguments
|
|
10
10
|
import com.facebook.react.bridge.Promise
|
|
11
11
|
import com.facebook.react.bridge.ReactApplicationContext
|
|
@@ -22,7 +22,7 @@ class AuthsignalWhatsappModule(private val reactContext: ReactApplicationContext
|
|
|
22
22
|
reactContext
|
|
23
23
|
) {
|
|
24
24
|
private val coroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
|
|
25
|
-
private var authsignal:
|
|
25
|
+
private var authsignal: AuthsignalWhatsApp? = null
|
|
26
26
|
private val defaultError = "unexpected_error"
|
|
27
27
|
|
|
28
28
|
override fun getConstants(): Map<String, Any>? {
|
|
@@ -40,7 +40,7 @@ class AuthsignalWhatsappModule(private val reactContext: ReactApplicationContext
|
|
|
40
40
|
val currentActivity = reactContext.currentActivity
|
|
41
41
|
|
|
42
42
|
if (currentActivity != null) {
|
|
43
|
-
authsignal =
|
|
43
|
+
authsignal = AuthsignalWhatsApp(tenantID, baseURL)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
promise.resolve(null)
|
|
@@ -84,7 +84,7 @@ class AuthsignalWhatsappModule(private val reactContext: ReactApplicationContext
|
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
private fun launch(promise: Promise, fn: suspend (client:
|
|
87
|
+
private fun launch(promise: Promise, fn: suspend (client: AuthsignalWhatsApp) -> Unit) {
|
|
88
88
|
coroutineScope.launch {
|
|
89
89
|
authsignal?.let {
|
|
90
90
|
fn(it)
|