私は検索で見つかったいくつかのことを試しましたが、httpやhttpsのURLでは何も動作しないようです。私は今AndroidManifest.xmlで以下のコードを使用しています。http/httpsが動作しないAndroidのインテントフィルタ
<intent-filter android:label="@string/app_name" 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="example" android:host="item" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/somepage" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/somepage/" />
</intent-filter>
例:// itemはアプリケーションを起動するために動作します。 https://example.comは機能せず、ブラウザのページを開くだけです。私は、各データタグを別のインテントフィルタに分割しようとしましたが、それはまだ動作しません。どんな助けでも大歓迎です。
はEDIT: 全マニフェスト:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="***"
android:versionCode="1"
android:versionName="1.0"
>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme"
android:largeHeap="true">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter android:label="@string/app_name" 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="example" android:host="item" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/somepage" />
<data android:scheme="https" android:host="example.com" android:pathPrefix="/somepage/" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
編集2: 私が見つけたその意図作品(アプリで開きます)私は、コマンドラインを介してこれを実行する場合: adb shell am start -W -a android.intent.action.VIEW -d "https://example.com/" *package*
と最後のスラッシュが必要です。後続のスラッシュなしでは機能しません。 しかし、アンドロイドクロムブラウザのリンクをクリックすると(スラッシュの有無にかかわらず)、アプリでは開きません。リンクはアプリではなくブラウザで開きます。以下の問題を修正しました追加
をフルマニフェストを追加してくださいしてください – Cliff
@Cliffは、上記追加 –