Website to app routing on iOS 9.3.2
I am trying to redirect my mobile web page to an app, using the documentation available in the website to app routing guide.
I have defined both URI scheme and universal link with the associated domain, but I still get a strange behavior:
- When I click a link with the branch.deepviewCta() function, I can see that I am redirected to the alternate link ( I can see that for a few seconds in safari)
- I am then redirected to the appstore and not the app even though I have it installed.
Haven’t tried it on a different iOS version.
Any ideas what might be wrong?
First of all, it sounds like you’re building something pretty awesome, but it’s definitely outside of a ‘normal implementation’ so it’s somewhat uncharted territory for me!
I wouldn’t recommend creating a second Branch app. I think you should be able to do what you need without that, and adding a second app in will cause all sorts of other headaches. Preserving the link data through install is one of our main features. Actually, that’s what deepviewCta() is specifically designed to do. If you wanted to manually recreate that functionality, you’d need to retrieve the link data (which you are doing) and then pass it through to a NEW link when the user presses the button to go on to the app store. I’m not sure what this will do to your analytics data though…you might end up recording twice as many link clicks, because I believe deepviewCta() does some work behind the scenes to reconcile this.
Did you investigate the fallback URL control parameters? I think this may be the answer to what you need, since you can override the app-wide redirection settings for specific links. The recommended approach would be to leave your App Store page as the app-wide default, and then set overrides on the links being generated inside the app.
This is the mobile web page I have created:
It has the script in the head section, and a link at the bottom which invokes deepviewCta()
The page is not redirecting me directly to the app, and when I click the link, it directs me to the alternate domain and then to the app store.
Unfortunately, I cannot give you the app yet since it is not approved, but I have configured Universal linking following your guide.
A few things to notice that might help identifying the problem:
- I have defined a custom sub domain: pingpong.app.link, but the alternate domain you specify is still using the old prefix: pnrk-alternate.app.link. Is this ok?
- I am using iOS 9.3, and configured universal linking (with your domains, including in itunes connect)
- I am almost sure that it worked the very first time I clicked on the link, as it went to the primary domain and not the alternate..
- I think it does not work on my windows desktop as well, since I should get the SMS landing page but instead I get my default url when clicking the link
If there is any other info you need to investigate this, I will provide since I would really like to use your services.
After removing and installing the app again, it seems that both primary and alternate link domains are working from the notes app.
Must be some bad configuration of the web link, even though I followed the instructions..
This is my web page with the JS api: http://ping-pong.me/~u2qlkw
Sounds like you might have run into the dreaded Universal Links disabling issue!
However, you’re right…something odd is still going on with the deeplinkCTA() call. What applinks: domains do you have configured in Xcode?
We looked into this on the backend…you’re right: pnrk-alternate.app.link should be pingpong-alternate.app.link. It looks like something went wrong, so we’re investigating this as a bug.
Thanks for looking into this issue.
After your change, I do get the pingpong-alternate.app.link domain.
It is not working on desktop as well, I am also redirected to the default url.
I have tried copying your exact sample code, and adding the content security meta tag but still nothing..
There are several things going on here:
- You should configure all your platform-specific routing rules on the Branch dashboard. Right now it looks like many of these are blank, and the error message of “We don’t know where to redirect!” exists for a reason :).
- The web-to-app-routing feature you’re using functions a bit differently from a normal Branch link, since it is intended to be a sort of ‘stopover point’ for a visitor who has already opened a Branch link. The button you’re using to trigger deepviewCta() won’t automatically follow all the platform-specific routing rules you set up on the Branch dashboard because it is actually intended to function as an alternative them. In other words, once a user lands on http://ping-pong.me/~u2qlkw, we assume they are there as the result of an $ios_url parameter (or other platform-specific param) in an earlier link, and won’t need additional routing. If you want to do this anyway, you can always specify something like ‘$desktop_url’: ‘https://google.com’, in the data dictionary of your deepview() call.
- I have tested this code on my end and do get Universal Link behavior when clicking the deepviewCta() button. Can you make sure these haven’t somehow been disabled again on your device?
I know I haven’t configured all the rules, since I do not have store links yet.
Anyways, following your point number 2, let me specify what I was trying to achieve, and maybe you can lead me to the right configuration..
My thoughts were, that users will invite their friends from the app by sending a link (which will be a regular link and not branch link). The friend will click the link and then one of 2 should happen:
- If the friend have the app, it should open
- If not, the friend should get a mobile web page with some data, and a button to download the app
What is the right way to achieve the above behavior?
Ahh….yes, I understand what you’re trying to do.
First of all, you need to put something in the rules areas, even if it’s a fake temporary URL. The redirection logic will fail in certain situations if those values are null.
Now on to the main question: the best approach is to have the invite link be a Branch link. That simplifies your flow considerably, since that should prevent the vast majority of users who already have the app from ever landing on your mobile web page in the first place. By not using a Branch link here, you start to run into these nasty edge cases. The open_app: true parameter (which you do have set) is designed to do what you’re wanting (automatically launch the app when the page is loaded) and in an ideal world it would, but there are many situations in which it fails. The most painful of these being Safari on iOS 9+ (thanks to Universal Links) and Chrome/Firefox (thanks to Chrome Intents) on Android.
However, if you really don’t want to use Branch for the invite link, then what you’re doing is the best approach. Just be aware that in some situations the user will have to click a button the launch the app instead of this happening automatically on page load!
Ok, so I managed to get it working with creating branch links in my app and sharing it from the app.
I used my own custom domain – u.ping-pong.me – and it works. (maybe you cannot see this configuration since I have created a second app – ping pong 2 for this test)
As said, I want users who do not have my app to see a mobile web page. Does it mean that I need to configure a “custom url” on my redirects with the page’s address?
How do I extract the link’s data? Can I extract it using PHP?
In the web page, should I use deepviewCta() to send the user to the app store?
The answer to all of your questions is yes :).
Thanks again for taking your time to answer!
So I think I got it working, just missing one last thing. What I did is:
- A branch link is created in the app with some custom data
- On the dashboard I am using a custom URL to point to a mobile web page if the app is not installed.
- Since I need some server data there, the mobile web page extracts the link data and redirects to a php page.
- On the php page, the user see the data from the link and has a “download app from app store” link
Now the last thing I want to achieve, is to let the user download the app while preserving the link data. I know this is one of your features, but my problem is that if I use the same branch app, the link redirect setting are now incorrect since again I am transferring the user to the custom url page and not to the app store…
What I was thinking of doing is create another branch app with different link settings, and use that on my php page.
First of all, I must tell you that It’s good to know you guys are taking your time to invest in some customer service (annoying) questions.. it’s important to know there is someone we can talk to..
I will try using a single app, and maybe play a bit with the control parameters.
Regarding analytics, since deep links are not a main feature in my app, I think I can live with that even on 2 apps.