深层链接在三星本机应用程序中不起作用
Deep links do not work in Samsung native apps
三星 Galaxy S6,Android Marshmallow 6.0。使用 Unity 开发。
三星的应用程序
深层链接 https:// 不 有效,但 intent:// 在工作:
- 互联网应用程序
- 备忘录应用程序
Google 的应用
https:// 和 intent:// do 都在:
- Google Chrome 应用
- Gmail 应用程序
是否有关于三星自定义应用程序的信息?
代码
assetlinks.json
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.xxx.app",
"sha256_cert_fingerprints":
["4E:CC:14:62:B3:1D:13..."]
}
}]
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- REPLACE com.companyname.projectname to your app bundle ID-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.app" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="23"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="1" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
<activity android:name="causallink.assets.DeepLinkBridge" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
<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" android:host="v.xxx.com" />
</intent-filter>
</activity>
</application>
</manifest>
P.S。我用谷歌搜索并找到 很多 的 SO 帖子,但我发现其中 none 确实有用。
你可以尝试这个多重配置..希望它的工作
<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="v.xxx.com"
android:pathPrefix="/yourpath"
android:scheme="http" />
<data
android:host="www.v.xxx.com"
android:pathPrefix="/yourpath"
android:scheme="https" />
<data
android:host="*.v.xxx.com"
android:scheme=""
android:path="/yourpath/" />
<data
android:path=""
android:pathPrefix="/*"
android:pathPattern="\?"
android:pathPattern="put your regex" />
</intent-filter>
您提到的 "https://" 深度 link 正在使用 Android 的应用程序链接机制打开应用程序(查看此 link 以获得良好的概述:https://blog.branch.io/technical-guide-to-deep-linking-android-app-links/).
"intent://" 深度 link 正在使用 Chrome 意图(检查:https://blog.branch.io/technical-guide-to-deep-linking-on-android-chrome-intents/)。
您提到的三星应用根本不支持应用链接 - 通常对应用链接的支持参差不齐。最安全的方法是同时支持 URI Scheme linking/Chrome intents 和 App Links,因为你会发现不同的应用程序只支持一个而不支持另一个 - 和 vice-versa.
三星 Galaxy S6,Android Marshmallow 6.0。使用 Unity 开发。
三星的应用程序
深层链接 https:// 不 有效,但 intent:// 在工作:
- 互联网应用程序
- 备忘录应用程序
Google 的应用
https:// 和 intent:// do 都在:
- Google Chrome 应用
- Gmail 应用程序
是否有关于三星自定义应用程序的信息?
代码
assetlinks.json
[{
"relation": ["delegate_permission/common.handle_all_urls"],
"target": {
"namespace": "android_app",
"package_name": "com.xxx.app",
"sha256_cert_fingerprints":
["4E:CC:14:62:B3:1D:13..."]
}
}]
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- REPLACE com.companyname.projectname to your app bundle ID-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.app" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="23"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="1" />
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
<activity android:name="causallink.assets.DeepLinkBridge" android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
<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" android:host="v.xxx.com" />
</intent-filter>
</activity>
</application>
</manifest>
P.S。我用谷歌搜索并找到 很多 的 SO 帖子,但我发现其中 none 确实有用。
你可以尝试这个多重配置..希望它的工作
<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="v.xxx.com"
android:pathPrefix="/yourpath"
android:scheme="http" />
<data
android:host="www.v.xxx.com"
android:pathPrefix="/yourpath"
android:scheme="https" />
<data
android:host="*.v.xxx.com"
android:scheme=""
android:path="/yourpath/" />
<data
android:path=""
android:pathPrefix="/*"
android:pathPattern="\?"
android:pathPattern="put your regex" />
</intent-filter>
您提到的 "https://" 深度 link 正在使用 Android 的应用程序链接机制打开应用程序(查看此 link 以获得良好的概述:https://blog.branch.io/technical-guide-to-deep-linking-android-app-links/).
"intent://" 深度 link 正在使用 Chrome 意图(检查:https://blog.branch.io/technical-guide-to-deep-linking-on-android-chrome-intents/)。
您提到的三星应用根本不支持应用链接 - 通常对应用链接的支持参差不齐。最安全的方法是同时支持 URI Scheme linking/Chrome intents 和 App Links,因为你会发现不同的应用程序只支持一个而不支持另一个 - 和 vice-versa.