在NFC标签上通过URL启动Android应用程序

时间:2012-09-04 13:37:18

标签: android nfc

我正在写一些NFC-Tag的URL来对主机名进行意图过滤 - 如果已安装则启动应用程序,或者如果未安装应用程序,则提供google-play链接。不幸的是只有浏览器出现了:

<intent-filter>
 <action android:name="android.intent.action.VIEW"></action>
 <category android:name="android.intent.category.DEFAULT"></category>
 <category android:name="android.intent.category.BROWSABLE"></category>
 <data android:host="example.com" android:scheme="http" />
</intent-filter>

1 个答案:

答案 0 :(得分:2)

行动需要有所不同:

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

仍然无需许可

相关问题