我是廣告,點擊一下吧!
標籤
#Flutter (11) 、 #PHP (8) 、 #Laravel (6) 、 #Mac (4) 、 #Dart (4) 、 #MySQL (4) 、 #VS Code (2) 、 #IDE (2) 、 #List (2) 、 #Android (2) 、 #Linux (2) 、 #Shell Script (2) 、 #addMonthNoOverflow (1) 、 #Deferred Join (1) 、 #subMonthNoOverflow (1) 、 #floorMonth (1) 、 #資安 (1) 、 #SVG (1) 、 #Directory Structure (1) 、 #SQL Injection (1) 、 #MySQL 效能 (1) 、 #subMonth (1) 、 #addMonth (1) 、 #Carbon (1) 、 #keytool (1) 、 #Play App Signing (1) 、 #copy (1) 、 #file_put_contents (1) 、 #file_get_contents (1) 、 #fwrite (1)Android 的 App Link 與 iOS 的 Universal Links 是可以讓手機點擊 HTTP URL Scheme (http:// or https://) 就直接開啟 APP 導向到指定頁面,也可在 APP 之間做轉跳。有別於 Deep Links 的 Custom Url Scheme 是可以避免跟其他 APP 命名衝突、或是發生使用者沒裝 APP 開啟後網頁一片白的窘境。
修改你的 AndroidManifest.xml
,將要開啟 APP 的 domain + path 放到 <activity>
之中。
android:scheme
:通常只要輸入 https,除非你特別要支援 http。android:host
:輸入你的 domain,如有測試環境也可一併加上,有 www 與沒 www 的算兩個 domain。android:pathPrefix
:因為不會是遇到網域底下所有頁面都要開啟 APP,這裡就是讓你輸入你要開啟的 path。<!-- App Links -->
<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" />
<!-- /download -->
<data android:scheme="https" android:host="joymap.tw" android:pathPrefix="/download" />
<data android:scheme="https" android:host="www.joymap.tw" android:pathPrefix="/download" />
<!-- /member/news -->
<data android:scheme="https" android:host="joymap.tw" android:pathPrefix="/member/news" />
<data android:scheme="https" android:host="www.joymap.tw" android:pathPrefix="/member/news" />
<!-- /store -->
<data android:scheme="https" android:host="joymap.tw" android:pathPrefix="/store" />
<data android:scheme="https" android:host="www.joymap.tw" android:pathPrefix="/store" />
</intent-filter>
將以下 json 放至網站 /.well-known/assetlinks.json (例如 https://joymap.tw/.well-known/assetlinks.json)package_name
需修改成你的 package_name sha256_cert_fingerprints
也是修改為你的指紋
[
{
"relation":[
"delegate_permission/common.handle_all_urls"
],
"target":{
"namespace":"android_app",
"package_name":"com.toby.joymap",
"sha256_cert_fingerprints":[
"c1:06:01:09:6c:e1:89:78:38:87:73:9a:34:1d:07:fe:bf:1b:b8:a2:e7:49:6e:11:70:d9:fb:67:22:e0:da:22"
]
}
}
]