facebookarchive / react-native-fbsdk

A React Native wrapper around the Facebook SDKs for Android and iOS. Provides access to Facebook login, sharing, graph requests, app events etc.
https://developers.facebook.com/docs/react-native
Other
2.99k stars 909 forks source link

Cannot complete login on iOS 13 #823

Closed platoonic closed 3 years ago

platoonic commented 3 years ago

šŸ› Bug Report

Triggering the FB login button shows a safari web view, then there user is prompted to be redirected to Facebook application, after finishing the login on the FB app, the user is redirected back to the original FB web view in my application and nothing happens.

To Reproduce

  1. Install FB native application on an iOS 13+ device.
  2. Login using FB
  3. Choose 'Continue in Facebook'
  4. Confirm the action on FB app
  5. The flow will be stuck in the web view and nothing will happen

    Expected Behavior

    The FB native application should trigger isLoginFinished on my application and hide the webview.

    Code Example

Environment

System: OS: macOS 11.0.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 509.58 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v12.18.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0 Android SDK: API Levels: 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2 System Images: android-30 | Google APIs Intel x86 Atom Android NDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild Languages: Java: 1.8.0_265 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: ~0.62.2 => 0.62.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

peymancyb commented 3 years ago

@platoonic how did you resolve this issue?

platoonic commented 3 years ago

@peymancyb After fiddling around with many online codes that I found for AppDelegate & SceneDelegate, I removed SceneDelegate since it wasn't even launching the application, and pasted the following code in my AppDelegate after '@Implementation AppDelegate' `

and in the didLaunchWithOptions method, just before it returns, add // FB SDK intialization [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];

Make sure to clean your build folder since changes sometimes do not take effect.

peymancyb commented 3 years ago

@platoonic great! Thank you so much! it worked for me as well!

karthikkncs14 commented 3 years ago

@platoonic It is not working for me IOS 14.3 Mac OS 11.1 Xcode 12.3 "react-native": "^0.63.2", "react": "16.13.1",

@implementation AppDelegate

What is wrong ?

I tried all things u tried -> "After fiddling around with many online codes that I found for AppDelegate & SceneDelegate, I removed SceneDelegate since it wasn't even launching the application, and pasted the following code in my AppDelegate after '@implementation AppDelegate'"

Also clean build folder stopped completely and started again but no luck

karthikkncs14 commented 3 years ago

@platoonic great! Thank you so much! it worked for me as well!

Can u post what you did as well ?