3

I want to write a NFC tag that opens a specific note in Google Keep when touched.

I have an URL in the form of https://keep.google.com/u/0/#LIST/<id> that does the desired action of opening the note in the installed Google Keep app on my phone when I read it with a QR-reader or click on it as a link.

When I write this URL to the tag an touch the tag afterwards, it opens in the browser. Is the NFC handler skipping other apps and opening it directly in a browser? When I clear the app-defaults for the browser, it shows a selection menu for the installed browsers after tapping the tag. Does anyone have an idea what I am doing wrong?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Torben E
  • 321
  • 3
  • 12

2 Answers2

3

Links on NFC tags are not launched as intents with the typical VIEW action. Consequently, other apps may not pick those links up correctly and you will instead experience the web browser to be opened. Only apps that specifically register for the intent action NDEF_DISCOVERED will be able to receive links from NFC tags. It seems that Google Keep currently does not do this, so there's not much you can do without creating your own wrapper app that handles these URLs and passes them on to Google Keep.

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
1

You should enable deeplinks in your activity. Also you should indicate your activity NFC tag discoverable as follows. You can learn anything about deep linking via this link

<activity
        android:name="ExampleActivity"
        android:label="Example">
        <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="example.com"
                android:scheme="http" />
            <data android:scheme="https" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.nfc.action.NDEF_DISCOVERED" />

            <category android:name="android.intent.category.DEFAULT" />

            <data android:mimeType="text/plain" />
        </intent-filter>
    </activity>
Halil ÖZCAN
  • 109
  • 4
  • Thanks for your answer. But I was actually looking to open the Google Keep app, where I don't have access to the activities. Like stated, the link works as desired when clicked or QR-scanned but opens in a browser when NFC-scanned. Is it mandatory that NFC is specifically stated to be accepted as a "URI-source"? – Torben E May 15 '19 at 21:29