Get rid of the app-selection dialog with Android App Links



id="hist_frame" name="hist_frame848832759" class="ss" tabindex="-1" style="height: 30px; left: -100px; position: absolute; top: -100px; width: 30px; font-family: Roboto, arial, sans-serif; font-size: 13px;">
與合適的人分享合適的內容。
首頁
個人資料
人脈
收藏集
熱門
社羣
活動
環聊
信息頁
設置
反饋
幫助  ·  地區
隱私權  ·  條款  ·  地圖條款
838,803 位關注者|109,036,217 次查看
 
Get rid of the app-selection dialog with Android App Links +Wojtek Kaliciński

With Android Marshmallow we launched Android App Links, a better way to connect Android apps with their website counterparts

App Links enable website owners to verify the linkage between their app and a domain that they control, so that when a user clicks a link to your site, Android can skip the app-selection dialog and proceed with opening the app directly.

There’s just a few things you need to do to enable App Links for your app:
1) add android:autoVerify="true" on one of your <intent-filter> tags that match web URLs
2) upload an assetlinks.json file with your certificate fingerprint to the /.well-known/assetlinks.json location on the web domains that you want to verify
3) install your APK on an Android Marshmallow emulator or device and test your App Links implementation

These steps, as well as the assetlinks.json format are explained in more detail in the DevByte (https://goo.gl/6ixwJa) and documentation (http://goo.gl/j3n9MD).

There are several caveats you need to be mindful of when implementing App Links:

App Links verification works per-app, not per <intent-filter> 

As long as you have android:autoverify=”true” on even one <intent-filter>, all domains from all web intent filters in your manifest will be checked for a validassetlinks.json file. If a single one of them fails, App Links will not be enabled for your app. 

Please note that for an <intent-filter> to be considered for verification, it must declare an android:scheme value of httphttps, or both. The filter must not declare any other schemes. The filter must also include the android.intent.action.VIEWaction and android.intent.category.BROWSABLE category.

Subdomains are treated as unique, separate hosts

If you want to use app links for subdomains, they must be explicitly listed in the<intent-filter> rules. You must also make sure that an assetlinks.json file is present on each subdomain. Unfortunately, HTTP 30x redirects are not supported at this time for App Links verification. There is however an include mechanism that you can use to point to another location if you want to reduce the amount of bookkeeping. Just put the following statement in your /.well-known/assetlinks.jsonfile and point it to a centralized configuration location:

[{ "include": "https://goo.gl/f5E2fv" }]

Note: HTTPS hosts can only include rules from another https:// URL.

If you find any blocking problems when implementing App Links, please sound off in the comments!
翻譯
79
29
Janusz Bagiński的個人資料照片Stefano Ciarcià的個人資料照片Daniel Deng的個人資料照片Gagal Mansukh的個人資料照片
3 條評論
Liran Barsisa
上午1:27
+
3
4
3
 
I have a question about this as a user: What if I do want to open the link on the web browser? Many times, the website has more features than the app, and also allows to copy text easily.
Even more than that: It seems that for the new "default apps" feature (which is similar to here), when I as a developer query all apps that can handle the intent, I get a single item instead of multiple ones. How can I avoid this?
翻譯
Mike DiGiovanni
上午2:24
 
I hate this :(
翻譯
 
Perfect solution!!!!always was looking for something familiar as itsvpretty annoyable to let user choose one action from many for only one action!
翻譯
發表評論…

id="hist_frame" name="hist_frame848832759" class="ss" tabindex="-1" style="height: 30px; left: -100px; position: absolute; top: -100px; width: 30px; font-family: Roboto, arial, sans-serif; font-size: 13px;">
與合適的人分享合適的內容。
首頁
個人資料
人脈
收藏集
熱門
社羣
活動
環聊
信息頁
設置
反饋
幫助  ·  地區
隱私權  ·  條款  ·  地圖條款
838,803 位關注者|109,036,217 次查看
 
Get rid of the app-selection dialog with Android App Links +Wojtek Kaliciński

With Android Marshmallow we launched Android App Links, a better way to connect Android apps with their website counterparts

App Links enable website owners to verify the linkage between their app and a domain that they control, so that when a user clicks a link to your site, Android can skip the app-selection dialog and proceed with opening the app directly.

There’s just a few things you need to do to enable App Links for your app:
1) add android:autoVerify="true" on one of your <intent-filter> tags that match web URLs
2) upload an assetlinks.json file with your certificate fingerprint to the /.well-known/assetlinks.json location on the web domains that you want to verify
3) install your APK on an Android Marshmallow emulator or device and test your App Links implementation

These steps, as well as the assetlinks.json format are explained in more detail in the DevByte (https://goo.gl/6ixwJa) and documentation (http://goo.gl/j3n9MD).

There are several caveats you need to be mindful of when implementing App Links:

App Links verification works per-app, not per <intent-filter> 

As long as you have android:autoverify=”true” on even one <intent-filter>, all domains from all web intent filters in your manifest will be checked for a validassetlinks.json file. If a single one of them fails, App Links will not be enabled for your app. 

Please note that for an <intent-filter> to be considered for verification, it must declare an android:scheme value of httphttps, or both. The filter must not declare any other schemes. The filter must also include the android.intent.action.VIEWaction and android.intent.category.BROWSABLE category.

Subdomains are treated as unique, separate hosts

If you want to use app links for subdomains, they must be explicitly listed in the<intent-filter> rules. You must also make sure that an assetlinks.json file is present on each subdomain. Unfortunately, HTTP 30x redirects are not supported at this time for App Links verification. There is however an include mechanism that you can use to point to another location if you want to reduce the amount of bookkeeping. Just put the following statement in your /.well-known/assetlinks.jsonfile and point it to a centralized configuration location:

[{ "include": "https://goo.gl/f5E2fv" }]

Note: HTTPS hosts can only include rules from another https:// URL.

If you find any blocking problems when implementing App Links, please sound off in the comments!
翻譯
79
29
Janusz Bagiński的個人資料照片Stefano Ciarcià的個人資料照片Daniel Deng的個人資料照片Gagal Mansukh的個人資料照片
3 條評論
Liran Barsisa
上午1:27
+
3
4
3
 
I have a question about this as a user: What if I do want to open the link on the web browser? Many times, the website has more features than the app, and also allows to copy text easily.
Even more than that: It seems that for the new "default apps" feature (which is similar to here), when I as a developer query all apps that can handle the intent, I get a single item instead of multiple ones. How can I avoid this?
翻譯
Mike DiGiovanni
上午2:24
 
I hate this :(
翻譯
Android Developer
上午5:02
 
Perfect solution!!!!always was looking for something familiar as itsvpretty annoyable to let user choose one action from many for only one action!
翻譯
發表評論…

發佈了6 篇原創文章 · 獲贊 6 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章