@onekeyfe/react-native-lite-card 1.0.10 → 1.0.11

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.
@@ -4,6 +4,7 @@ import android.app.Activity
4
4
  import android.nfc.tech.IsoDep
5
5
  import android.util.Log
6
6
  import androidx.fragment.app.FragmentActivity
7
+ import androidx.lifecycle.Lifecycle
7
8
  import com.google.gson.Gson
8
9
  import kotlinx.coroutines.Dispatchers
9
10
  import kotlinx.coroutines.withContext
@@ -38,6 +39,9 @@ object OneKeyLiteCard {
38
39
 
39
40
  NfcPermissionUtils.checkPermission(activity) {
40
41
  printLog(TAG, "startNfc Have permission")
42
+ if (!activity.getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.RESUMED)) {
43
+ return@checkPermission
44
+ }
41
45
 
42
46
  NfcUtils.mNfcAdapter?.enableForegroundDispatch(
43
47
  activity, NfcUtils.mPendingIntent, NfcUtils.mIntentFilter, NfcUtils.mTechList
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-lite-card",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "lite card",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",