I try to login Facebook from IOS APP.
But getting ERROR : Error: The supplied auth credential is malformed or has expired.
Initially, it works fine, but suddenly got this error .
This is my code
`
const result = await LoginManager.logInWithPermissions(['public_profile', 'email']);
console.log('result', result);
if (result.isCancelled) {
this.isLoading = false;
return; // throw new Error('User cancelled request'); // Handle this however fits the flow of your app
}
const data = await AccessToken.getCurrentAccessToken();
console.log(data, 'data');
if (!data) {
this.isLoading = false;
Toast.show(Constant.ErrorMessages.FacebookError);
return;
}
const userLargeImage = await this.fetchLargeProfileImage(data);
const credential = firebase.auth.FacebookAuthProvider.credential(data.accessToken);
// login with credential
const currentUser = await firebase.auth().signInWithCredential(credential);
const { id, email, first_name, last_name } = currentUser.additionalUserInfo.profile
// const { photoURL } = currentUser.user
let savingTime = new Date().getTime();
Hey guys,
I try to login Facebook from IOS APP. But getting ERROR : Error: The supplied auth credential is malformed or has expired. Initially, it works fine, but suddenly got this error .
This is my code
` const result = await LoginManager.logInWithPermissions(['public_profile', 'email']); console.log('result', result); if (result.isCancelled) { this.isLoading = false; return; // throw new Error('User cancelled request'); // Handle this however fits the flow of your app } const data = await AccessToken.getCurrentAccessToken(); console.log(data, 'data'); if (!data) { this.isLoading = false; Toast.show(Constant.ErrorMessages.FacebookError); return; } const userLargeImage = await this.fetchLargeProfileImage(data); const credential = firebase.auth.FacebookAuthProvider.credential(data.accessToken); // login with credential const currentUser = await firebase.auth().signInWithCredential(credential); const { id, email, first_name, last_name } = currentUser.additionalUserInfo.profile // const { photoURL } = currentUser.user let savingTime = new Date().getTime();
`