Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFC tags don't emit url events through Linking #26552

Closed
cimitan opened this issue Sep 24, 2019 · 2 comments
Closed

NFC tags don't emit url events through Linking #26552

cimitan opened this issue Sep 24, 2019 · 2 comments
Labels
API: Linking Bug Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@cimitan
Copy link
Contributor

cimitan commented Sep 24, 2019

React Native version:
All react-native versions

Steps To Reproduce

  1. Make sure your Android manifests contains the correct NDEF actions
<uses-permission android:name="android.permission.NFC" />
...
        <intent-filter>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="https" android:host="www.example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="https" android:host="example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="http" android:host="www.example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="http" android:host="example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="app" android:host="example" android:pathPrefix="/some-path/" />
          <data android:scheme="app" android:host="com.example" android:pathPrefix="/some-path/" />
        </intent-filter>
        <intent-filter>
          <action android:name="android.nfc.action.NDEF_DISCOVERED" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="https" android:host="www.example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="https" android:host="example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="http" android:host="www.example.com" android:pathPrefix="/some-path/" />
          <data android:scheme="http" android:host="example.com" android:pathPrefix="/some-path/" />
        </intent-filter>
  1. Scan a NFC tag with an URL
  2. Check if Linking.addEventListener('url', ({url}) => console.warn('event url': url)) gets called

Describe what you expected to happen:
I see a console.warn

@cimitan cimitan added the Bug label Sep 24, 2019
facebook-github-bot pushed a commit that referenced this issue Sep 26, 2019
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
@stale
Copy link

stale bot commented Dec 23, 2019

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Dec 23, 2019
@stale
Copy link

stale bot commented Dec 30, 2019

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Dec 30, 2019
@facebook facebook locked as resolved and limited conversation to collaborators Dec 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API: Linking Bug Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

2 participants