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 907 forks source link

(Resolved) LoginWithPermission of undefined #587

Open Ethan0007 opened 5 years ago

Ethan0007 commented 5 years ago

Follow this instruction: https://developers.facebook.com/docs/ios/getting-started/

if you got LoginWithPermission error download the latest version of the FBSDK: https://github.com/facebook/facebook-objc-sdk/releases

FBSDKCoreKit.zip FBSDKLoginKit.zip FBSDKShareKit.zip (Unzip and move it to user/Documents/FBSDK)

then do the following crucial parts. (Xcode)

  1. Drag the FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework to Frameworks,
  2. Add RCTFBSDK.xcodeproj into libraries from you node_modules (/ios).
  3. Drag the FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework to RCTFBSDK.xcodeproj under frameworks folder.

clean and build your project.

fabriciosautner commented 5 years ago

Hello! my problem is similar but instead of undefined is "TypeError: null is not an object"

I followed your footsteps and it didn't work either, I think it must really be the problem of RN 0.6 or do you have any other ideas about?

Ethan0007 commented 5 years ago

hello, can you please screenshot the error on you mobile screen i think we have different error cause this fix is for LoginWithPermission of undefined.

fabriciosautner commented 5 years ago

Hello @Ethan0007 ,

follow:

image

Ethan0007 commented 5 years ago

@fabriciosautner ,

did you add this configuration?

Screen Shot 2019-08-10 at 4 21 28 PM
fabriciosautner commented 5 years ago

Hello @Ethan0007 !

I am not using RCTLinkingManager, my appdelegate configuration looks like this: (I am also using Google authentication)

- (BOOL)application:(UIApplication *)application openURL:(nonnull NSURL *)url options:(nonnull NSDictionary<NSString *,id> *)options {
  return  [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url
    sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
    annotation:options[UIApplicationOpenURLOptionsAnnotationKey]] ||
    [RNGoogleSignin application:application
                             openURL:url
                   sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                          annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}

and:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

                        [[FBSDKApplicationDelegate sharedInstance] application:application
    didFinishLaunchingWithOptions:launchOptions];

  return YES;
}
fabriciosautner commented 5 years ago

Solved it!

I had tried to import the SDK manually via XCODE and with the new installation updates via automatic linking I forgot to remove.

Now everything is going well.

Thanks!