2

Could anybody help me out please? iOS Branch deep link does not open application on device, but works well on simulator. My simulator OS version is 10.3, my iPhone 5s OS version is 10.3.3

What I have done:

Dashboard: Settings -> Link Settings:

  1. "Always try to open app" is checked
  2. "IOS URI Scheme" is set to the application's custom URI scheme.
  3. "Enable Universal Links" is checked.
  4. Bundle Identifier & Apple App Prefix are both set correctly.

Link Domain was set as bellow:

enter image description here

Test Link was created as bellow:

enter image description here

Xcode Configuration:

1.Associated Domains

enter image description here

2.Info.plist file

enter image description here enter image description here

And, code as bellow:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { [[Branch getInstance] handleDeepLink:url]; BOOL success = NO; success = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; if (!success) { success = [router handleURL:url withCompletion:nil]; } //force return YES return YES; } - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray *))restorationHandler { BOOL ret = NO; ret = [[Branch getInstance] continueUserActivity:userActivity]; if (!ret) { ret = [router handleUserActivity:userActivity withCompletion:NULL]; } //force return YES return YES; } 

What I tested:

  1. I sent the Test Deep Link to my email, and I open the email through Safari. While I click the url on DEVICE, an alert was shown to tell me App Store will be open. While I click the url on SIMULATOR, my app was open successfully.

  2. I pasted the Test Deep Link into Notes on DEVICE, while I click the url, an action sheet was shown and provide two option: open in Safari, Open in xxx(my app name). I click both options, they all could open my app successfully.

Here is all the configuration, code, steps, and I have also tried to change branch_app_domain to applinks:xxxapp.app.link, it didn't work neither.

Is there anything that I missed during the integration procedure? Any suggestion would be very appreciate. Thanks in advance!

Roby

5
  • I am not sure I understand your issue. I checked with your app available on the App Store, clicking on the Branch link opens your App. So I believe Universal links work perfectly. You also mention that you pasted it in the Notes App, and it shows the 'Open in <<yourApp>>, which is again proof that Universal links work fine. There could be a possibility that you disabled Universal links on your phone by mistake (clicking on app.link in the top right corner disables Universal links) but you can reenable them by following the Notes App test. Commented Aug 29, 2017 at 15:53
  • Could you provide a little more detail on what exactly is not working. PS: I would suggest to not use the simulator for Universal links as they are not the best replication of the real world scenario. Commented Aug 29, 2017 at 15:55
  • @AmrutaDeshmukh Thanks for your reply. I installed my app from app store which has already integrated branch in and configured as above. Tried the ways bellow: 1. Sent the deep link to my email, open the email in Safari, click the link in the email web page, an alert view was shown to tell me App Store will be launched. But I think my app should be launched directly. 2. Tried to open the deep link with Safari, an alert view was shown to tell me App Store will be launched. But I think my app should be launched directly. Commented Aug 30, 2017 at 6:33
  • @AmrutaDeshmukh Neither application:continueUserActivity:restorationHandler: nor application:openURL:sourceApplication:annotation: was called in the above ways. Also, I have tried Ad-Hoc distributed application, not working. Is it clear? Commented Aug 30, 2017 at 6:33
  • @AmrutaDeshmukh I pasted the link in Notes app, if I click the link directly, Safari was launched and tell me App Store will be launched. But, if I long press the link, and select 'open in xxx<my app>', my app was launched, after that, I click the link directly, my app was launched successfully. Why I must select 'open in xxx<my app>' before I click the link directly to launch my app successfully? it's strange. In my mind, every time when I click the link, no matter in web page, in Notes app or other app, my app should be launched directly. Is it? Thanks! Commented Aug 30, 2017 at 6:40

1 Answer 1

2

Amruta from Branch.io here:

I tested with your App available on the App Store and Universal links work as expected. I shared the link via Slack, the default Email App on iOS as well as the Gmail app. On all three platforms clicking on the Branch link for your App opened your App via Universal links as expected.

Based on your description of testing it looks like you are disabling Universal links (clicking the breadcrumb on the top right link disables Universal links.

Diabling Universal links

To re-enable Universal Links for an app: 1. Paste one of your Branch links into a new note 2. Perform a long press on the link (note: if you see a "preview" window pop open, you are pressing too hard)

Reenabling Universal links

Note that this is a 'per-device' issue, so if you accidentally disable Universal Links on one phone, it won't affect other users.

Unfortunately, there is no way to ensure that a user does not disable Universal links by mistake. However, there is a silver lining, this will no longer be an issue post iOS 11. With iOS 11 the breadcrumb in the top right corner has disappeared and so has the ability to disable Universal Links.

Sign up to request clarification or add additional context in comments.

4 Comments

Thanks a lot for your kindly reply, not clear how to prevent this issue, but I got the clue of this issue from your reply. Thanks again!
@roby Unfortunately there is no way to prevent this in iOS versions prior to iOS 11. However, as I mentioned in my post, once iOS 11 is launched this will no longer be an issue, as Apple has removed the ability to disable Universal links.
I have tried it, didn't see the button at the top right corner. Could you please teach me how to do it? And, I tried enable the universal link as your suggestion, paste the Branch link in Notes app, long press, click 'Open in xxx' to launch app, then click the Branch link directly, it works fine to launch the app. Then I paste the Branch link into Safari to open or click the Branch link in Email app, an alert view was shown unexpectedly to tell me App Store will be launched. It looks this only works through Notes app now.
@roby don't paste the link in Safari. To replicate the Universal link behavior, you should share it via some platform, such as iMessage or Slack etc. and then click on the link. When you click on a Branch link for an App which has Universal links configured it opens the App directly and does not need the Safari browser. Since you are pasting the link in Safari the link is not behaving as a Universal link.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.