2

I am doing project in php. For email verification I am sending an email to user as ,

Hi, 

We need to make sure you are human. Please verify your email and get started using your Website account. 

http://siteurl/email-verification/cc6560387c1111558bf5424046f2dc2b

When user clicks on the given link he will redirect to a browser page with message as,

Your account is actived.

Click here to go back to application.

But now I am having trouble in redirection to my android application. I don't know how to redirect user back to my application. For now I have tried to redirect user to facebook by using code as,

<a href="https://facebook.com/me" data-applink="fb://profile">Click here</a> to go back to application.

<script>
    $('a[data-applink]').applink();
</script>

but it opens facebook in browser not facebook application. Is there any way to do this?

I have done something like, where EngageV1 is my application name

<div id="main" style="text-align: center; color: #787878">
        <h2><?php echo $msg; ?></h2>
        <a href="https://play.google.com/store/apps/details?id=engage.app.v1&ah=yIEhKqv-vh5CnjQrIULLeVouxkA" class="large-screen">Click here</a> to go back to application.
        <a href="EngageV1://" class="small-screen">Click here</a> to go back to application.
    </div>


<script>
    setTimeout(function () { window.location = "https://play.google.com/store/apps/details?id=engage.app.v1&ah=yIEhKqv-vh5CnjQrIULLeVouxkA"; }, 25);
    window.location = "EngageV1://";
</script>
AmarjaPatil4
  • 1,640
  • 3
  • 28
  • 41

1 Answers1

1

You need to use App Links.

What you need to do is create a URL associating with activity of and Android application, so when User opens that link that can be opened in application itself.

Go through android docmentation for detailed information on how to add app links and attaching them up with web URLs.

https://developer.android.com/training/app-links/index.html

Android 6.0 (API level 23) and higher allow an app to designate itself as the default handler of a given type of link.

So users with API level lower then 23 will have to select the opening app of a Web URL. At least once.

Community
  • 1
  • 1
Alok Patel
  • 7,842
  • 5
  • 31
  • 47