3

First of all I'd like to say that I have a fully working implementation of Firebase Dynamic Links. Suppose we have the following dynamic url: https://cardition.page.link/fYvz6CU61p1DXHud8

This url will behave properly when being opened by an android.intent.action.VIEW (it will open the app and pass it some id to identify the resource if you have the app installed otherwise it will take you to its PlayStore page and so on...)

However I've written the same url on an NFC tag and I imagined it will behave the same (basically the system's default browser will try to open that link and follow the same flow described as above)

It appears to me that this is true only for Firefox based browsers, while Chromium based ones will forever redirect me to the app's PlayStore page (I also think they fail to pass the extra data to identify the card, so the app will behave as if installed normally)

I am aware of solutions using AAR records, but this has a downside, as a new user who downloads the app will have to re-scan the tag in order to get the extra bit of information.

Now, is there a way around this issue on Chrome engines or do I have to look into implementing my own deep-linking functionality as described in this post.

For the record, this is how the NFC tag data looks like: nfc

Alex Ionescu
  • 413
  • 6
  • 20
  • 1
    Struggling with the same issue a year later and I can confirm that Chromiums have this issue while Firefox builds don't. And as Todd Allen said it doesn't send the `action.VIEW` intent but the `action.NDEF_DISCOVERED` action won't help at all. Any way to resolve it? – menilv Jun 23 '20 at 19:53

1 Answers1

4

I just encountered the same issue, and it turns out that NFC doesn't send an action.VIEW intent. The solution is to create another intent filter similar to this (nearly identical to your Dynamic Link intent but with NDEF_DISCOVERED):

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

I spent hours banging my head on this. Heh. -T

Todd Allen
  • 41
  • 2