@expensify/react-native-wallet 0.1.29 → 0.1.31
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
|
@@ -24,7 +24,13 @@ def isNewArchitectureEnabled() {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
apply plugin: "com.android.library"
|
|
27
|
-
|
|
27
|
+
// AGP 9 ships built-in Kotlin support and registers the `kotlin` extension
|
|
28
|
+
// itself. Applying the Kotlin plugin on top of it fails configuration with
|
|
29
|
+
// "Cannot add extension with name 'kotlin'". Only apply it when nothing has
|
|
30
|
+
// registered that extension yet.
|
|
31
|
+
if (project.extensions.findByName('kotlin') == null) {
|
|
32
|
+
apply plugin: "kotlin-android"
|
|
33
|
+
}
|
|
28
34
|
|
|
29
35
|
if (isNewArchitectureEnabled()) {
|
|
30
36
|
apply plugin: "com.facebook.react"
|
|
@@ -21,6 +21,8 @@ import com.google.android.gms.tapandpay.issuer.PushTokenizeRequest
|
|
|
21
21
|
import kotlinx.coroutines.CoroutineScope
|
|
22
22
|
import kotlinx.coroutines.Dispatchers
|
|
23
23
|
import kotlinx.coroutines.launch
|
|
24
|
+
import kotlinx.coroutines.SupervisorJob
|
|
25
|
+
import kotlinx.coroutines.cancel
|
|
24
26
|
import com.expensify.wallet.Utils.getAsyncResult
|
|
25
27
|
import com.expensify.wallet.Utils.toCardData
|
|
26
28
|
import com.expensify.wallet.error.InvalidNetworkError
|
|
@@ -50,6 +52,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
|
|
|
50
52
|
private val tapAndPayClient: TapAndPayClient = TapAndPay.getClient(activity)
|
|
51
53
|
private var pendingCreateWalletPromise: Promise? = null
|
|
52
54
|
private var pendingPushTokenizePromise: Promise? = null
|
|
55
|
+
private val moduleScope = CoroutineScope(SupervisorJob() + Dispatchers.Main)
|
|
53
56
|
|
|
54
57
|
override fun initialize() {
|
|
55
58
|
super.initialize()
|
|
@@ -58,6 +61,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
|
|
|
58
61
|
|
|
59
62
|
override fun invalidate() {
|
|
60
63
|
super.invalidate()
|
|
64
|
+
moduleScope.cancel()
|
|
61
65
|
reactApplicationContext.removeActivityEventListener(cardListener)
|
|
62
66
|
}
|
|
63
67
|
|
|
@@ -119,7 +123,7 @@ class WalletModule internal constructor(context: ReactApplicationContext) :
|
|
|
119
123
|
|
|
120
124
|
@ReactMethod
|
|
121
125
|
override fun getSecureWalletInfo(promise: Promise) {
|
|
122
|
-
|
|
126
|
+
moduleScope.launch {
|
|
123
127
|
try {
|
|
124
128
|
val walletId = getWalletIdAsync()
|
|
125
129
|
val hardwareId = getHardwareIdAsync()
|
package/ios/WalletManager.swift
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expensify/react-native-wallet",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "A React Native module designed for seamless integration of Card Push Provisioning into Apple Wallet and Google Wallet, enabling easy and secure addition of payment cards directly from your application.",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "lib/commonjs/index",
|