From 07fb1e166170bf16f5bf783c2dd91fd35fa548ed Mon Sep 17 00:00:00 2001 From: Andrea Cimitan Date: Tue, 24 Sep 2019 17:08:41 +0100 Subject: [PATCH] Also listen to NFC actions for linking url events --- .../main/java/com/facebook/react/ReactInstanceManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 4be00d52779e95..f6842435ceefec 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -36,6 +36,7 @@ import android.content.Intent; import android.content.res.Configuration; import android.net.Uri; +import android.nfc.NfcAdapter; import android.os.Bundle; import android.os.Process; import android.util.Log; @@ -462,7 +463,9 @@ public void onNewIntent(Intent intent) { String action = intent.getAction(); Uri uri = intent.getData(); - if (Intent.ACTION_VIEW.equals(action) && uri != null) { + if (uri != null + && (Intent.ACTION_VIEW.equals(action) + || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) { DeviceEventManagerModule deviceEventManagerModule = currentContext.getNativeModule(DeviceEventManagerModule.class); deviceEventManagerModule.emitNewIntentReceived(uri);