Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android deep linking schema: match both http and https

Tags:

I want my app to open on http://www.example.com and https://www.example.com.

This works:

            <data                 android:host="www.example.com"                 android:path="/"                 android:scheme="http"/>              <data                 android:host="www.example.com"                 android:path="/"                 android:scheme="https"/> 

Is it possible to catch both with one entry? I tried:

            <data                 android:host="www.example.com"                 android:path="/"                 android:scheme="http*"/> 

but this catches only the http link, not the https one.

So I know how I can handle bot variants, but want to use the most concise writing possible.

like image 298
fweigl Avatar asked Sep 14 '16 09:09

fweigl


People also ask

How does deeplink work on Android?

In Android, a deep link is a link that takes you directly to a specific destination within an app. The Navigation component lets you create two different types of deep links: explicit and implicit.

What is the difference between deep links and app links?

When a user click an URL, it might open a dialog which asks the user to select one of multiple apps handling the given URL. On the other hand, An Android App Link is a deep link based on your website URL that has been verified to belong to your website. When user clicks that URL, it opens your app.

How do I configure deeplink?

Adjust Deeplink Generator To use the tool, log in to your Adjust dashboard and open the Menu, where you'll see the 'Deeplink Generator' as an option. Click to open, and you'll find a page to input the information required to create your deep link. Then simply copy and paste into whichever campaign you've set up.

How do I find deep links on Android?

Test your deep links You can use the Android Debug Bridge with the activity manager (am) tool to test that the intent filter URIs you specified for deep linking resolve to the correct app activity. You can run the adb command against a device or an emulator.


2 Answers

This seems to do the trick for me:

<intent-filter>     <action android:name="android.intent.action.VIEW" />      <category android:name="android.intent.category.DEFAULT" />     <category android:name="android.intent.category.BROWSABLE" />      <data android:scheme="http" />     <data android:scheme="https" />     <data android:host="www.mywebsite.com" />     <data android:pathPrefix="/mypage.php" /> </intent-filter> 
like image 129
Muzikant Avatar answered Nov 18 '22 19:11

Muzikant


You can use seperate <intent-filter> for both

<intent-filter>        <action android:name="android.intent.action.VIEW" />        <category android:name="android.intent.category.DEFAULT" />        <category android:name="android.intent.category.BROWSABLE" />        <data             android:host="www.example.com"             android:path="/"             android:scheme="http"/>      </intent-filter> <intent-filter>        <action android:name="android.intent.action.VIEW" />        <category android:name="android.intent.category.DEFAULT" />        <category android:name="android.intent.category.BROWSABLE" />        <data             android:host="www.example.com"             android:path="/"             android:scheme="https"/>      </intent-filter> 
like image 21
Ravi Avatar answered Nov 18 '22 19:11

Ravi