0

Branch.io can't find my app, when I try to open link in Facebook App. It always redirects to the App Store, even when our app is already installed on the device. I've read https://blog.branch.io/deep-linking-from-facebook-in-2017/ and implemented Deepviews, but even from there I can't get into the app. It still opens App Store.

I assume that the problem is in our Branch.io configuration, but I can't find it.

Notes:

  1. I've implemented Universal Links and they work fine (except this problem with Facebook).
  2. When I press on "Open in Safari" in the Facebook app, it also works fine.
  3. Deepview always shows "Get the app" instead of "Open app", when the app is already installed.

This is how I create the link:

- (BranchUniversalObject *)generateBranchObjectFor:(MBMediaObject *)object {
    NSArray<NSString *> *pathComponents = [object.shareLink pathComponents];
    NSString *uid = [[pathComponents subarrayWithRange:NSMakeRange(pathComponents.count-2, 2)] componentsJoinedByString:@"/"];
    BranchUniversalObject *branchObject = [[BranchUniversalObject alloc] initWithCanonicalIdentifier:uid];
    branchObject.title = object.name;
    branchObject.imageUrl = object.imageURL.absoluteString;
    if ([object isKindOfClass:MBSong.class]) {
        branchObject.contentDescription = ((MBSong *)object).artistName;
    } else if ([object isKindOfClass:MBAlbum.class]) {
        branchObject.contentDescription = ((MBAlbum *)object).artist.name;
    }
    return branchObject;
}

- (BranchLinkProperties *)generateBranchLinkPropertiesForObject:(MBMediaObject *)object channel:(NSString *)channel {
    BranchLinkProperties *properties = [BranchLinkProperties new];
    properties.feature = @"sharing";
    properties.channel = channel;
    [properties addControlParam:@"$deeplink_path" withValue:[[object.shareLink stringByReplacingOccurrencesOfString:@"http://" withString:@""] stringByReplacingOccurrencesOfString:@"https://" withString:@""]];
    return properties;
}

NSString *shortURLString = [[self generateBranchObjectFor:object] getShortUrlWithLinkProperties:[self generateBranchLinkPropertiesForObject:object channel:@"twitter"]];

And this is our link settings:

1
  • I have exactly the same problem. Deep linking works from Safari but not from Facebook. I followed the same blog post as you and can't figure out why it doesn't work. I tried editing the deepview HTML to add the property "al:web:should_fallback" as false, but still it won't work. I'm stumped now. Branch's documentation is really confusing. Commented Aug 15, 2017 at 17:06

1 Answer 1

3

Amruta from Branch.io here:

Due to a restriction on Apple's side, when the user taps on a Universal link on the web browser (i.e. Safari), if the link has the same domain as the current web page it does not use Universal linking to open the app but instead opens the link in Safari. You can read more about this behavior here.

To overcome this restriction, Branch uses a different domain for the link behind the Deepview button, so that the domain being visited is different from the current web page. The link behind the Deepview button uses the domain of the format '-alternate.app.link'.

Please ensure that you have added the -alternate.app.link domain for your app in the entitlements file. You can check the documentation providing information on how to add the domains here.

5
  • Thanks very much Amruta! That does make so that the app is opened instead of the App Store. It'd be great if it were added to the documentation to make it easier for people to discover it. Another problem I have now is that the button in the deepview always says "get the app", even now that it takes straight to the app when installed. Is there anything missing so that the button says "open the app" instead? Commented Aug 15, 2017 at 18:23
  • @RafaelAlencar Thank you so much for your feedback. I have updated the documentation on our website and it should be live in a day or two. Commented Aug 16, 2017 at 21:35
  • @RafaelAlencar The default Deepview CTA is configured such that it shows 'Get The App' when the app is not installed and 'Open the App' when the App is installed. However, the Deepview CTA button depends on Branch seeing the app open or installs for the first time. So if a user installs the app organically from the App store Branch will not be able to change the Deepview CTA from “Get” to “Open”. To change the Deepview CTA from “Get” to “Open” a user needs to click the Deepview CTA button and be directly deep linked into your app. It might take about 30 mins for our backend systems to update. Commented Aug 16, 2017 at 21:39
  • I see. Thanks for the explanation Amruta! Commented Aug 19, 2017 at 20:26
  • @AmrutaDeshmukh could you please help check my problem stackoverflow.com/q/45930696/1115791 ?
    – roby
    Commented Aug 29, 2017 at 7:13

Not the answer you're looking for? Browse other questions tagged or ask your own question.