how to implement google instant app with NFC in an

2020-04-30 17:31发布

问题:

i want to run instant app when tapping nfc tag in android studio. currently my simple instant app is crash when calling NFCAdapter.

回答1:

Instant Apps cannot currently access NFC hardware. The list of permissions supported by Instant Apps can be found here and you can see that the android.permission.NFC is not supported.

If you want to trigger your Instant App when a NFC tag is tapped, that should work if you tie an Instant App-enabled URL to a tag. When that tag is accessed and the URL opened by the system, the Instant App should trigger instead.