Skip to content

Commit

Permalink
fix: use FLAG_IMMUTABLE to fix android 31 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
timmarschallnordsense committed Feb 10, 2023
1 parent 6c5b637 commit 55eccc3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nfc.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,10 @@ export class Nfc implements NfcApi {

this.setOnNdefDiscoveredListener((data: NfcNdefData) => {
if (!writeGuardAfterCheck) {
console.log("Skip read, writeGuardAfterCheck is not ready", writeGuardAfterCheck);
console.log(
"Skip read, writeGuardAfterCheck is not ready",
writeGuardAfterCheck
);
return;
}
this.setOnNdefDiscoveredListener(null).then(() => {
Expand All @@ -495,7 +498,7 @@ export class Nfc implements NfcApi {
resolve(data);
});
});

setTimeout(() => {
writeGuardAfterCheck = true;
console.log("Start writeGuardAfterCheck", writeGuardAfterCheck);
Expand Down Expand Up @@ -547,7 +550,7 @@ export class Nfc implements NfcApi {
activity,
0,
this.intent,
0
67108864
);

// The adapter must be started with the foreground activity.
Expand Down

0 comments on commit 55eccc3

Please sign in to comment.