Search code examples
iosswiftfbsdkfbsdkloginkit

Facebook app login request do not open in FB iOS app , it opens in Safari mobile browser


I used FBSDK for get user information. But user request permission pop in a safari mobile browser. I need to open FB app in ios instead of popping safari browser, but browser should show up if user didn't download ios fb app. How can i achieve this one ? ( I tested this on my iPhone 5s and still pop the safari instead of native FB app , but here i attached the simulator image )

enter image description here


Solution

  • This is because you are using the latest FBSDK and running on iOS 9.0+ which supports SFSafariViewController.

    FBSDK has added support for SFSafariViewController so instead of opening in Safari, it will open directly in your app in SFSafariViewController. This should be fine for your purposes.

    On earlier versions of iOS it will still open in Safari.