Skip to content

Commit 8d8c3d4

Browse files
cimitanfacebook-github-bot
authored andcommitted
Also listen to NFC actions for linking url events (#26553)
Summary: This PR solves bug #26552 for Android. Allows an app to receive url events through Linking from NFC tags ## Changelog [Android] [Fixed] - This branch checks also for `ACTION_NDEF_DISCOVERED` intent matches to send the url events Pull Request resolved: #26553 Test Plan: Tested the code multiple times with both NFC tags and normal links Differential Revision: D17589654 Pulled By: cpojer fbshipit-source-id: 55e854e765a84da5e22ec2cc51d0fe0972254175
1 parent 46090b0 commit 8d8c3d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import android.content.Intent;
3737
import android.content.res.Configuration;
3838
import android.net.Uri;
39+
import android.nfc.NfcAdapter;
3940
import android.os.Bundle;
4041
import android.os.Process;
4142
import android.util.Log;
@@ -462,7 +463,9 @@ public void onNewIntent(Intent intent) {
462463
String action = intent.getAction();
463464
Uri uri = intent.getData();
464465

465-
if (Intent.ACTION_VIEW.equals(action) && uri != null) {
466+
if (uri != null
467+
&& (Intent.ACTION_VIEW.equals(action)
468+
|| NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) {
466469
DeviceEventManagerModule deviceEventManagerModule =
467470
currentContext.getNativeModule(DeviceEventManagerModule.class);
468471
deviceEventManagerModule.emitNewIntentReceived(uri);

0 commit comments

Comments
 (0)