Redirect from facebook to ios app - deep link

喜夏-厌秋 提交于 2019-12-01 11:01:33

This is expected behavior

Unfortunately it is not currently possible to directly launch a third-party app from within the iOS Facebook app. This is a known issue that Facebook has essentially written off as wontfix. This is still possible in the Android Facebook app, but it's unfortunate they haven't been more transparent about the change to the iOS version because there is quite a bit of confusion about it.

Instagram is a special case because it is a Facebook-owned app and gets different treatment.

But you can work around it

Services like Branch.io (full disclosure: I am on the team) get around this by implementing a judicious combination of App Links, URI schemes, and iOS Universal Links. Essentially what you need to do is open a page in the webview and then have a button or other user-driven CTA event that launches the app from there. It's an extra step for the user, but currently the best workaround. If you just want to be able to post a link that goes into your app when it is installed and otherwise goes to a webpage (or the App/Play Store), then Branch links are definitely your simplest solution.

Branch link routing logic

i think you have not added LSApplicationQueriesSchemes

<key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>

Add this in your plist.

- (BOOL)application: (UIApplication *)application
            openURL: (NSURL *)url
  sourceApplication: (NSString *)sourceApplication
         annotation: (id)annotation
{

    if ([url.scheme isEqualToString:@"Your Url Sceme"])

    {
        return [[FBSDKApplicationDelegate sharedInstance] application:application
                                                              openURL:url
                                                    sourceApplication:sourceApplication
                                                           annotation:annotation];

    }

}

\

hope it will help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!