Javascript 如何在Android上使用带有路径参数的React导航通用链接?
我有以下域:Javascript 如何在Android上使用带有路径参数的React导航通用链接?,javascript,android,react-native,react-navigation,deep-linking,Javascript,Android,React Native,React Navigation,Deep Linking,我有以下域:https://demoproject.com 我想将所有带有/demo路径参数的URL-s链接到Android上的React本机应用程序,例如URLhttps://demoproject.com/demo?a=1&b=2将被链接,但将排除具有相同域但不同路径参数的任何其他URL 现在我使用的是React Navigation 5,如下所示: const linking = { prefixes: ['https://demoproject.com'], config
https://demoproject.com
我想将所有带有/demo
路径参数的URL-s链接到Android上的React本机应用程序,例如URLhttps://demoproject.com/demo?a=1&b=2
将被链接,但将排除具有相同域但不同路径参数的任何其他URL
现在我使用的是React Navigation 5,如下所示:
const linking = {
prefixes: ['https://demoproject.com'],
config: {
DemoScreen: {
path: '/demo/*'
}
}
};
<NavigationContainer linking={linking}>
const链接={
前缀:['https://demoproject.com'],
配置:{
演示屏幕:{
路径:'/demo/*'
}
}
};
AndroidManifest.xml
链接本身工作正常,但问题是所有带有前缀https://demoproject.com
正在链接,而我只希望链接带有/demo
路径参数的URL-s
我试过:
-没有链接任何URL-s
-所有带有前缀:['https://demoproject.com/demo']
域已链接https://demoproject.com
有没有办法解决这个问题或者我做错了什么?必须在IntentFilter中用
路径前缀
或路径模式
定义它:
<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" />
<data android:host="demoproject.com" android:pathPrefix="/demo/" />
</intent-filter>
android:pathPrefix锁定了它
<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" />
<data android:host="demoproject.com" android:pathPrefix="/demo/" />
</intent-filter>