Reputation: 16771
I have the following intent filter in my manifest to accept deep-link urls:
<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.example.com"/>
<data android:host="example.com"/>
<data android:pathPattern="/path.*" />
</intent-filter>
Everything works great when tapping on links such as:
However - in Twitter, URLs are automatically shortened to something like this:
(sorry for pic - SO won't let me post a shortened link example... wth?)
This URL is then resolved into the real URL when the user hits the link - however(!!), at this point once the URL is resolved into one that matches the above examples, android no longer seems to care about my intent filter and the URL is opened in a browser.
How can I resolve this so that URLs to my app from twitter properly open my app (or at least open the app picker)?
Upvotes: 2
Views: 4116
Reputation: 13613
You are correct — with App Links, Android checks the actual URL being opened to see if any app is registered to handle it. If the URL is shortened (assuming the shortened domain itself is not registered, which is obviously the case with t.co
), then subsequent URLs reached via redirects are not considered. iOS Universal Links work exactly the same way.
On Android, you have two options:
Upvotes: 1