Instant Apps with NFC

北战南征 提交于 2019-12-04 10:13:18

问题


I'm trying to get an instant app to be opened via NFC.

I have something like the below in my AndroidManifest.xml

            <intent-filter android:autoVerify="true">
            <action android:name="android.intent.action.VIEW" />
            <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" />
            <data android:scheme="http" />
            <data android:host="example-refresh.herokuapp.com" />
        </intent-filter>

When going to https://example-refresh.herokuapp.com (example link obviously) from a link click the instant app loads correctly. When opening that link from an nfc tag the browser just loads. I've tried also having the nfc open an AAR (https://developer.android.com/guide/topics/connectivity/nfc/nfc.html#aar) this results in the play store link opening when the app isn't installed and the app correctly opening from the nfc when it is installed. If I have something else on the nfc so it shows the disambigious options then I can select instant app for the browser option, but I would like for it to default to instant app.

Is there something I'm missing to get an nfc tag to load an instant app? I've also tried using branch, but with no luck.

来源:https://stackoverflow.com/questions/46948624/instant-apps-with-nfc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!