Android 防止Chrome吞噬NFC深层链接
我有一个安卓测试应用程序,可以从NFC记录的深层链接打开。它可以工作,但只有在禁用Chrome时才能工作。如果Chrome没有被禁用,它甚至不会询问,它只会打开Chrome 舱单:Android 防止Chrome吞噬NFC深层链接,android,nfc,deep-linking,Android,Nfc,Deep Linking,我有一个安卓测试应用程序,可以从NFC记录的深层链接打开。它可以工作,但只有在禁用Chrome时才能工作。如果Chrome没有被禁用,它甚至不会询问,它只会打开Chrome 舱单: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package=
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp">
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="www.example.com"
/>
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="www.example.com"
/>
</intent-filter>
</activity>
</application>
</manifest>
如您所见,它是为查看和NDEFèU发现的操作注册的。在查看操作(例如单击Slack的链接)时,它会询问我是否要打开Chrome或我的应用程序。然而,对于NDEFèU发现的操作,如果没有禁用Chrome,它将直接打开Chrome。如果Chrome被禁用,它将询问他们是否打开我的应用程序
我听说这可能与安卓10有关,但我不知道是否有我可以请求的许可或其他可以绕过这种行为的东西。我正在运行Android 10的OnePlus 6T上试用。这是否回答了您的问题@Jameido——这是一个等价的问题,但没有回答这个问题。答案是假设有一大堆我没有做的事情。我在多部手机上试用过,效果都一样。Chrome并没有设置为吞并所有的URL,事实上,当它来自非NFC来源时也不会这样做。只有在NFC来源上,Chrome似乎会自动吞并URL,而不管其意图是什么。