Search code examples
androiddeep-linkingintentfilterchrome-custom-tabs

Deeplinking in android application


I'm trying to introduce a deeplinking in my application. This is the process:

  • Open the Android app
  • Click a button
  • Button opens a chrome custom tab with specific url
  • Chrome browser shows a form
  • When you submit the form, you redirect to payment page (payment page url is something like that xyz.com/objetId?callbackUrl=encodedCharacters) When I am redirected to this payment url, I want to go back to a different activity for the same Android app. Because for this url there is a webView intent. I want to show it in the app.

I tried to add intent-filters for deeplinking. When I submit to form still, I'm staying in the chrome custom tab. (I mean in the browser) But I want to go back to app.

Is it possible?


Solution

  • I solved my problem with custom scheme in AndroidManifest.xml

    <data android:host="backToApplication"
    android:scheme="someSchemeLikeHttp"/>
    

    I was using https as scheme but for links, default application is default browser in the phone. I changed the schema and I'm sending my schema and host in the url callback like

    ?callback_url=someSchemeLikeHttp://backToApplication
    

    Now it's working for me.