Closed platoonic closed 3 years ago
@platoonic how did you resolve this issue?
@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' `
(BOOL)application:(UIApplication )application openURL:(NSURL )url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey] ]; // Add any custom logic here. return handled; } `
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.
@platoonic great! Thank you so much! it worked for me as well!
@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
(BOOL)application:(UIApplication )application openURL:(NSURL )url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey] annotation:options[UIApplicationOpenURLOptionsAnnotationKey] ]; // Add any custom logic here. return handled; }
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions {
InitializeFlipper(application);
self.moduleRegistryAdapter = [[UMModuleRegistryAdapter alloc] initWithModuleRegistryProvider:[[UMModuleRegistryProvider alloc] init]]; // [GMSServices provideAPIKey:@"AIzaSyALbedaMDLDgwDpltVfnGBKjGfXoQUsnsg"]; RCTBridge bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"xxxxNamexxx" initialProperties:nil];
rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible]; [FIRApp configure]; [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions]; return YES; }
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
@platoonic great! Thank you so much! it worked for me as well!
Can u post what you did as well ?
š 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
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