Closed eran-pinhas closed 5 years ago
Same issue, any ideas
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: Cannot read property 'logInWithPermissions' of undefined
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.
same issue
I resolve issue for me.
check is implement this method in your MainActivity
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
}
@aanah0 where did you download the FB SDK 5.0 from
I resolve issue for me.
check is implement this method in your MainActivity
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data); }
My issue is in IOS, not in Android. Would you please give any idea for IOS?
i also had same issue with IOS, resolved it by downgrading version to: pod 'FBSDKCoreKit', ~> 4.40.0' pod 'FBSDKLoginKit', ~> 4.40.0' pod 'FBSDKShareKit', ~> 4.40.0' and using logInWithReadPermissions
i am using RN 58.4
I have found the following line in react-native-fbsdk(latest)->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. I think that's why I am always getting the error like, LoginManager undefined. But FBLoginManager is available when I console the same in Android! Can anybody fix this issue?
Any fix?
I have found the following line in react-native-fbsdk(latest)->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. I think that's why I am always getting the error like, LoginManager undefined. Can anybody fix this issue?
Where is the exact issue then? The issue is in react-native or react-native-fbsdk? The same thing is working fine in Android! Actually I am not sure if anything wrong in my end, so can anybody give me the steps to integrate a successful facebook login in react-native(in IOS only)?
i have the same issue on android
any solution ?? i am facing same issue ..
I got the same issue on Android but it's working fine on iOS. and my main activity implement the onActivityResult (solution proposed by dsgithub2018 does not help)
i resolved this with onActivityResult solution + adding "implementation 'com.facebook.android:facebook-login:[5,6)'" in build.gradlew (dependencies
I solved it by upgrading from v0.10.1
to v1.0.1
. Remember to remove all the CallbackManager
stuff in MainApplication.java
We have a fix for some callbacks not getting called on android in v1.0.2, also like mentionned previously make sure to remove all CallbackManager
stuff.
I'm not using cocopod but still has this issue
@cchamikara I wasn't using Cocoapods either, but it still fixed it. FBSDK's at version 5.3.0.
@kentrh I did remove frameworks and download them from https://github.com/facebook/facebook-objc-sdk/releases/tag/v5.3.0 and dragged them to frameworks again and tried but still same issue , Am I doing correct thing ?
@cchamikara I guess there's quite some config to be done when not using CocoaPods, so you should follow the instructions at https://github.com/facebook/react-native-fbsdk. Make sure you put your SDK's in ~/Documents/FacebookSDK
and that you upgrade the package with yarn upgrade react-native-fbsdk --latest
But isn't this really an Android issue? For me it was always working on iOS, but the promise was never returned on Android.
@kentrh yes I did follow all the steps , it is working on Android but not in iOS
@cchamikara Did you find the solution for this issue? It works well on Android but with iOS, it built fail with this one: "Initializing 'FBSDKLoginManagerLoginResult __strong' with an expression of incompatible type 'void (^)(FBSDKLoginManagerLoginResult strong, NSError *strong)'"
Hi,
In android - the promise returned from the logInWithPermissions function seems to be ok but it's not resolved (nor rejected...) after successful login. same issue when using the
<LoginButton />
callbacks are not being called back.What am I missing? anyone seen that behavior before?
FYI: it seems that this package is not well supported. Issues are not being closed (~20% open issues) and not all functions are documented. I really think facebook can do a tiny bit better
Thanks y'all