[英]How to add Cordova app to browser list in Android
我想注冊我的應用程序,以便Android將其識別為瀏覽器,以便用戶在看到http鏈接的“打開方式”時可以選擇我的應用程序。
在配置中是否有要執行的插件或配置?
謝謝。
我已經找到了問題的答案,希望這可以對其他人有所幫助。 您可以參考效果很好的自定義URL插件 ,您只需要將方案設置為“ https”,您的應用程序就可以接收https調用。
cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=https
現在,如果您希望它也接受https並可能添加其他方案,則需要編輯AndroidManifest文件並添加意圖:
<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="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" />
</intent-filter>
謝謝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.