我已经研究了大多数自定义URL方案的问答,我还没有找到我可能的答案。
我希望我的应用程序通过在浏览器中单击某个URL (移动设备上的任何URL )来启动,问题是我给定的URL不能被修改,因为它也服务于IOS应用程序,它看起来像这样:
“我的应用程序://http://www.name.com/path/path2/”
我不确定如何处理"myapp://http://“”并构造一个适当的意图过滤器,但我尝试的所有内容都不起作用。任何帮助都将不胜感激,如果我错过了相关的答案,请不要错过我的道歉。
这就是我到目前为止所尝试的:
<activity
android:name="com.myapp.test.SplashScreen"
android:exported="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<!-- Test for URL scheme -->
<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.name.com"
android:path="/path/path2/"
android:scheme="http" />
<data
android:host="www.name.com"
android:path="/path/path2/"
android:scheme="https" />
<data android:scheme="myapp" />
</intent-filter>
<!-- End Test for URL scheme -->
</activity>注意:我尝试过使用/不使用导出的:true
https://stackoverflow.com/questions/18102528
复制相似问题