I am using react-native-fbsdk for login in react-native app. after all setup , I am getting some error.
code I used for login action
facebook = () => {
console.log("LoginManager ", LoginManager);
console.log("Login ", LoginManager.logInWithReadPermissions);
LoginManager.logInWithReadPermissions([
"public_profile"
]).then(result => {
if (result.isCancelled) {
console.log("Login cancelled");
} else {
console.log(
"Login success with permissions",
result.grantedPermissions.toString()
);
}
});
};
now here is my console output 1 :
LoginManager
Object {logInWithReadPermissions: function, logInWithPublishPermissions: function, getLoginBehavior: function, setLoginBehavior: function, getDefaultAudience: function…}
getDefaultAudience
:
function getDefaultAudience()
getLoginBehavior
:
function getLoginBehavior()
logInWithPublishPermissions
:
function logInWithPublishPermissions(permissions)
logInWithReadPermissions
:
function logInWithReadPermissions(permissions)
logOut
:
function logOut()
setDefaultAudience
:
function setDefaultAudience(defaultAudience)
setLoginBehavior
:
function setLoginBehavior(loginBehavior)
now here is my console output 2 :
function logInWithReadPermissions(permissions) {
return LoginManager.logInWithReadPermissions(permissions);
}
Error : Cannot read property 'logInWithReadPermissions' of undefined what is missing here not able to get .
might you can follow this video tutorial about iOs + Facebook Configuration.
Also you can review the command
react-native link
to link well the FBSDK libraries.Hope that my answer helps you.