Android深度链接模式:匹配http和https
我希望我的应用程序在Android深度链接模式:匹配http和https,android,android-manifest,deep-linking,Android,Android Manifest,Deep Linking,我希望我的应用程序在http://www.example.com和https://www.example.com 这项工作: <data android:host="www.example.com" android:path="/" android:scheme="http"/> <data andro
http://www.example.com
和https://www.example.com
这项工作:
<data
android:host="www.example.com"
android:path="/"
android:scheme="http"/>
<data
android:host="www.example.com"
android:path="/"
android:scheme="https"/>
是否可以用一个条目同时捕获这两个条目?我试过:
<data
android:host="www.example.com"
android:path="/"
android:scheme="http*"/>
但这只捕获http链接,而不是https链接
因此,我知道如何处理bot变体,但希望尽可能使用最简洁的文字 您可以使用separate
来处理这两个问题
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:path="/"
android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:host="www.example.com"
android:path="/"
android:scheme="https"/>
</intent-filter>
这似乎对我很有帮助:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.mywebsite.com" />
<data android:pathPrefix="/mypage.php" />
</intent-filter>
这是不可能的,我想我也是,这是不可能的。我不认为这个字段支持正则表达式,但你可以尝试android:scheme=“https?”
这也可以工作:
这是我想要避免的,我想拥有最短的可能性(在清单中的字符数)。有时你无法避免,除非你要更改操作系统编码:)我已经添加了,但我的应用程序仍然没有上传