Closed r-julien closed 4 years ago
I don't know if you saw, but this comment in another issue solves the problem: https://github.com/facebook/react-native-fbsdk/issues/755#issuecomment-634101710
No, I didn't see this message. To solve this, I created a new project and copy-paste my code and everything is working now. So I didn't try to add a .swift file to my project to see if it solves the problem.
Thank you :)
you can downgrade to version ^1.1.2 and it should be good to go
🐛 Bug Report
Hello, I'm facing some issues trying to install react-native-fbsdk for iOS.
When I try to build the project npx react-native run-ios I get a build failed and the following error
To Reproduce
1- yarn add react-native-fbsdk 2- cd ios/ && pod install
3- Add the code in my AppDelegate.h
` /**
import "AppDelegate.h"
import <React/RCTBridge.h>
import <React/RCTBundleURLProvider.h>
import <React/RCTRootView.h>
import <FBSDKCoreKit/FBSDKCoreKit.h>
@implementation AppDelegate
(BOOL)application:(UIApplication )application didFinishLaunchingWithOptions:(NSDictionary )launchOptions { [[FBSDKApplicationDelegate sharedInstance] application:application didFinishLaunchingWithOptions:launchOptions];
RCTBridge bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; RCTRootView rootView = [[RCTRootView alloc] initWithBridge:bridge moduleName:@"pocketle" 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]; return YES; }
(NSURL )sourceURLForBridge:(RCTBridge )bridge {
if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
else
return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
endif
}
(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; }
@end
`
4- And run npx react-native run-ios
Expected Behavior
Build success
Is anyone facing the same issue and got some solution? Thanks for helping