1

I have an Android app that should open links on the app which clicks from the web browser.

I have the following intent filters:

 <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>

        <intent-filter android:autoVerify="true">
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <action android:name="android.intent.action.VIEW" />


            <data android:scheme="http" android:host="www.mysite.com" />
            <data android:scheme="https" android:host="www.mysite.com" />
        </intent-filter>

And also i checked the my signed sha256 key, package name etc from the assetjson file which is in the mysite/.well-known/assetlinks.json. Everythings looks correct. But the app still not opening when i click the links from the website.

aligur
  • 3,387
  • 3
  • 34
  • 51

1 Answers1

1
<activity android:name=".YourActivity">

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:scheme="http" />
        <data android:host="mysite.com" />
    </intent-filter>

</activity>
Simon Marquis
  • 7,248
  • 1
  • 28
  • 43
  • i noticed that my code was working when clicks from the google etc. But how can i working it on the web site? – aligur Jun 16 '16 at 13:22
  • Explain with more details. I don't understand what you're saying. – Simon Marquis Jun 16 '16 at 13:28
  • i want to handle all clicks event on the web page. Not for just google etc. For example when i am in the web page and then click a link i can redirect the my app. How can i achieve it. Applinks doest work in this case. – aligur Jun 16 '16 at 13:30
  • It doesn't makes sense. Whenever a link to mysite.com is triggered, you app will be launched, that's all. – Simon Marquis Jun 16 '16 at 13:31
  • What if i manuelly write to my site name on the address bar? In this case applinks doesnt works – aligur Jun 16 '16 at 13:33
  • This is the expected behaviour for all major browsers and you wont be able to change it. If user is writing the url in the browser, it means he/she wants to use the browser. – Simon Marquis Jun 16 '16 at 13:34
  • 1
    Thanks. But in the ios there is a bar top of the screen which provides to redirect to app. Is there way to achieve it in android? – aligur Jun 16 '16 at 13:35
  • No, at least not that I'm aware of unfortunately. – Simon Marquis Jun 16 '16 at 13:37
  • Thanks you for your helps – aligur Jun 16 '16 at 13:41