Android deep linking into an app

前端 未结 4 1999
梦谈多话
梦谈多话 2021-02-01 07:27

I am trying to create a link that can be sent via email which when opened on an android device with my app installed will automatically open the correct page in my app.

4条回答
  •  滥情空心
    2021-02-01 07:46

    This technique actually seems to be working on Android from what I can tell:

    http://mobile.dzone.com/news/custom-url-schemes-phonegap

    I haven't tried it in a real production app yet, so your mileage may vary. What I've done is use that technique of creating a hidden iframe and attempting to set the location to the custom url scheme, and call the function from onload for the document. What I've seen so far (I've only tested it out on 2.2 and 2.3 devices) is that if I have an app installed that handles the custom scheme the app will launch, and if not the page will render.

    Relatively clean single URL to cover both cases, and doesn't ruin things like Twitter shares of the URL. A real production version might only do the hidden iframe probe if the request is coming from something that looks like a platform that might support the application to reduce the risk of incompatible desktop behavior.

提交回复
热议问题