Make a link in the Android browser start up my app?

前端 未结 9 1140
小鲜肉
小鲜肉 2020-11-21 22:06

Is it possible to make a link such as:

click me!

cause my Anton app to start

9条回答
  •  野性不改
    2020-11-21 23:00

    Once you have the intent and custom url scheme for your app set up, this javascript code at the top of a receiving page has worked for me on both iOS and Android:

    
    

    This has only been tested on the Android browser. I am not sure about Firefox or Opera. The key is even though the Android browser will not throw a nice exception for you on window.open(custom_url, '_blank'), it will fail and return null which you can test later.

    Update: using store_loc = "https://play.google.com/store/apps/details?id=com.raditaz"; to link to Google Play on Android.

提交回复
热议问题