Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error : FacebookSDK has not been initialized yet using react native

So I am trying to add a facebook sign up connect to firebase to my react-native application and expo keep telling me this error . I dont really know what to do because I thought that Facebook SDK was auto initialized on Application start.

This is my Sign In function.

enter image description here

like image 983
Philippe Vincent Avatar asked Jan 25 '26 04:01

Philippe Vincent


1 Answers

According to the documentation: https://docs.expo.io/versions/latest/sdk/facebook/, you need to initialize the SDK with this function:

Facebook.initializeAsync(appId: string | undefined, appName: string | undefined): Promise<void>

Calling this method ensures that the SDK is initialized. You have to call this method before calling logInWithReadPermissionsAsync to ensure that Facebook support is initialized properly.

You should call this method in your App.js or any top level component.

like image 59
MBach Avatar answered Jan 27 '26 23:01

MBach