Is there a way to pass a message from an Android browser to an app?

后端 未结 4 839
死守一世寂寞
死守一世寂寞 2021-02-05 22:27

I have a situation where I\'d like for some data to be passed from a mobile web site to a native Android app. A complication is that, in the normal case, the native Android app

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 23:21

    Use a GET parameter: http://exampleapps.com?token=mK7Fyt5 Think of the way the YouTube app works. You're sent to the link for a video. If you don't have the YouTube app, you see the mobile site (which in your case could be an install link). If you do, you get asked whether to open the YouTube link with the native app, and the native app is passed the URL from which it was invoked, from which it can parse out the parameter for the video to show.

    Use the following intent filter:

    
        
        
    
    

提交回复
热议问题