通过NFC标签上的URL启动Android应用程序
我写了一个指向NFC标签的URL,目的是过滤主机名——如果安装了应用程序,请启动该应用程序;如果未安装该应用程序,请提供指向google play的链接。不幸的是,只有浏览器出现:通过NFC标签上的URL启动Android应用程序,android,nfc,Android,Nfc,我写了一个指向NFC标签的URL,目的是过滤主机名——如果安装了应用程序,请启动该应用程序;如果未安装该应用程序,请提供指向google play的链接。不幸的是,只有浏览器出现: <intent-filter> <action android:name="android.intent.action.VIEW"></action> <category android:name="android.intent.category.DEFAULT">
<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>
操作需要不同:
<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>
仍然不需要权限操作需要不同:
<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>
仍然不需要许可