Android deep linking into an app

前端 未结 4 1998
梦谈多话
梦谈多话 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:32

    1 - Set Custom URL schemes like http://example.com

    For example, the URL http://example.com/?id=95 , will open up the relevant FAQ and the URL http://example.com/?sectionid=8 (where sectionid is the publish id of any Section), will open up relevant section.

    2 - Define in your AndroidManifest.xml your DeepLinkActivity (the one that will receive the URL data:

    
                
                    
                    
                    
                    
                 
            
    

    3 - Override the onResume() method of your DeepLinkActivity class:

    @Override
    protected void onResume() {
        super.onResume();
    
        Intent in = getIntent();
        Uri data = in.getData();
        System.out.println("deeplinkingcallback   :- "+data);
    }
    

提交回复
热议问题