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

TypeError: LoginManager.logInWithPermissions is not a function in IOS #615

Open dsgithub2018 opened 5 years ago

dsgithub2018 commented 5 years ago

Hi, I am not able to setup react-native-fbsdk in IOS whereas it is working fine in ANDROID. I am using react-native 0.60.4 and in my package.json I have mentioned, "react-native-fbsdk": "git+https://github.com/facebook/react-native-fbsdk.git" and my pod file is like,

pod 'FBSDKCoreKit', '~> 5.0'

pod 'FBSDKLoginKit', '~> 5.0'

pod 'FBSDKShareKit', '~> 5.0'

But I am always getting the below error after each successful build in IOS, TypeError: LoginManager.logInWithPermissions is not a function

I am using LoginManager.logInWithPermissions(["public_profile", "email"]) in my code. I am not able to fix this issue from NEW REACT-NATIVE 0.60.0, now the latest version is 0.60.4, but still the same issue! Please help me to fix this issue.

Also in IOS I have found the following line in react-native-fbsdk->js->FBLoginManager.js, const LoginManager = require('react-native').NativeModules.FBLoginManager;

But when I console the require('react-native'), I saw there is no FBLoginManager in NativeModules. But in android FBLoginManager is available in NativeModules. I think that's why I am always getting the error in IOS like, TypeError: LoginManager.logInWithPermissions is not a function

Can anybody fix this issue?

fabriciosautner commented 5 years ago

Same problem here

taminhtien commented 5 years ago

Same problem

BrunoLagoa commented 5 years ago

Same problem here. React Native 0.59.9

Ankushds commented 5 years ago

there is any solution for this issue. Simulator Screen Shot - iPhone X - 2019-08-12 at 18 08 46

taminhtien commented 5 years ago

Follow this instruction work for me: https://github.com/facebook/react-native-fbsdk/issues/603

dsgithub2018 commented 5 years ago

603

I just followed the above link for IOS. No, the issue still not fixed.

fariya12 commented 5 years ago

having same error in android with react-native 0.60 . how can i solve it ... any working solution ?

leandrolimasi commented 5 years ago

same error here, only in IOS

adybuciuman commented 5 years ago

Follow this instruction work for me: #603

is not working for me.

edu1525 commented 5 years ago

Same problem here, 30 days trying to solve this issue...

adybuciuman commented 5 years ago

@edu1525 I was able to fix it after a few days of struggling. try to follow this Issue #603

edu1525 commented 5 years ago

Thanks @adybuciuman, I solve it now just changing LoginManager.logInWithPermissions to LoginManager.logInWithReadPermissions. Its strange because the first one worked on Android.