@onetokenfe/react-native-nfc-wallet-sdk 0.1.1 → 0.1.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.
@@ -41,7 +41,9 @@ class NfcWalletSdkModule(private val reactContext: ReactApplicationContext) :
41
41
  ActivityHolder.init(reactContext.applicationContext as android.app.Application)
42
42
  reactContext.addActivityEventListener(activityEventListener)
43
43
  reactContext.addLifecycleEventListener(this)
44
- ensureEngine()
44
+ // Do not ensureEngine() here. Eagerly creating WalletNfcController used to
45
+ // enable Reader Mode on every onHostResume and steal tags from Lite
46
+ // BackupCardSdk. Engine is created on first wallet API call instead.
45
47
  }
46
48
 
47
49
  override fun invalidate() {
@@ -254,7 +256,9 @@ class NfcWalletSdkModule(private val reactContext: ReactApplicationContext) :
254
256
  }
255
257
 
256
258
  override fun cancelNfcWait() {
257
- controller?.cancelWait()
259
+ // Full release: cancel waiters, clear held IsoDep, and disable Reader Mode
260
+ // so BackupCardSdk / Lite foreground dispatch can receive tags again.
261
+ controller?.releaseHeldTag()
258
262
  }
259
263
 
260
264
  override fun checkNFCPermission(promise: Promise) {
@@ -50,7 +50,12 @@ class WalletNfcController(private val activity: Activity) {
50
50
  }
51
51
 
52
52
  fun onResume() {
53
- enableReaderMode()
53
+ // Only reclaim Reader Mode when we own an active wallet session or a held
54
+ // tag. Enabling unconditionally steals every tag from BackupCardSdk
55
+ // (Lite foreground dispatch) and blocks Lite backup card discovery.
56
+ if (sessionBusy || WalletNfcTagHolder.tag != null) {
57
+ enableReaderMode()
58
+ }
54
59
  }
55
60
 
56
61
  fun onPause() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onetokenfe/react-native-nfc-wallet-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "React Native SDK for OneToken NFC Wallet card (instance 6F6E65746F6B656E02)",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",