8

I'm implementing Facebook login in my app. it works fine if a user doesn't have the Facebook App, but it fails when the user has Facebook App. Because when logging in, it promotes to use the app to do login. And once signed in within the Facebook App, it comes back and stuck at the signin screen.

see the following screen recording:

https://flair-inventory.s3-us-west-2.amazonaws.com/RPReplay_Final1591237513.MP4

The following project can reproduce the same issue. build and install this app on a device, and at the same time, install facebook app on the same device.

The following app can reproduce this issue:

https://github.com/LeeKahSeng/SwiftSenpai-FB-Integration-Demo

Bill Yan
  • 3,369
  • 4
  • 27
  • 42
  • Looks like you are using some deprecated feature... check this thread https://github.com/facebookarchive/react-native-fbsdk/issues/785#issuecomment-678446870 – jalamprea Apr 16 '21 at 15:53
  • 1
    Same problem here. Did you find a solution ? – Jerem Lachkar Apr 25 '21 at 22:23
  • same problem, in my case it seems linked to iOS13 and the SceneDelegate update required, however the FB documentation is poor as usual and I could not find any clear solution anywhere. – ceyquem Jul 10 '21 at 01:31

2 Answers2

2

If you set step login facebook is correct you should check Appdelegate below function maybe in your code return false.

try follow this it's work for me in same case your video.

func application( _ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:] ) -> Bool {
                    
    return ApplicationDelegate.shared.application( app, open: url, sourceApplication: options[UIApplication.OpenURLOptionsKey(rawValue: UIApplication.OpenURLOptionsKey.sourceApplication.rawValue )] as? String, annotation: options[UIApplication.OpenURLOptionsKey.annotation] )
                    
 }
Papon Smc
  • 576
  • 4
  • 11
1

Credit to this post:

In my case, after adding the extra code of the SceneDelegate as per FB documentation, I also needed to add the .onOpenURL { ... } code on the LoadingView() called in my MotherView like this example:

var body: some Scene {
    WindowGroup {
        LoadingView()
            .onOpenURL { (url) in
                ApplicationDelegate.shared.application(
                    UIApplication.shared,
                    open: url,
                    sourceApplication: nil,
                    annotation: [UIApplication.OpenURLOptionsKey.annotation]
                )
            }
    }
}
Dharman
  • 30,962
  • 25
  • 85
  • 135
ceyquem
  • 2,079
  • 1
  • 18
  • 39