Problem loading App via custom URL scheme within Twitter browser


#1

I have an iOS app (and Android, but let’s focus on iOS for now) that is all set up to correctly handle a custom URL scheme (e.g., myappname://resource-token). I have a web page set up to redirect to this custom URL, let’s say it’s at http://myappname.com/resource-token.

If I view my site in my iOS mobile browser (Safari and Chrome), the page redirects my device to the app as I would expect and hope. However, if I tweet said URL, and I click on that URL within the Twitter iOS app, it doesn’t switch to my app. Instead, I get a confirmation dialog that says:

Open URL
myappname://resource-token
with Cancel and Open as options.

Clicking “Open” opens my app and performs the deep linking action as expected.

There is a post here with nearly my exact problem: https://twittercommunity.com/t/loading-custom-url-scheme-from-within-twitter-ios-app-browser/6676 but no responses and it’s in another area, which is why I’m posting here.

This is the javascript on my page:

<script>
window.onload = function() {
    document.location = "myappname://resource-token";
}
</script>

I’ve tried “window.location” and “document.location.href” with no difference in result.

I want this to open my app directly without asking for confirmation. I am certain this was working once before but it has broken and I have been unable to identify what changed or how to fix it.

Any information or help that might help resolve this issue would be greatly appreciated. Thank you.


#2

Did you get anywhere with this?
We have the same problem and it’s really frustrating.

Not only is ‘cancel’ an issue but if the user doesn’t have your app installed then they’re just left hanging.
In fact the whole deeplinking issue is a mess.