问题描述
我正在使用库 react-native-fbsdk,一切正常。 但是,当用户单击按钮以通过 facebook 登录时......会出现一个屏幕,上面写着“你想继续吗”......这显示了反应原生标志(原子)。有没有办法显示不同的标志? (最好是 facebook 标志)
下面的代码
<SocialIcon
title="Sign In With Facebook"
button
type="facebook"
onPress={() => {
_facebookSignin();
}}
/>
_facebookSignin = async () => {
try {
const result = await LoginManager.logInWithPermissions([
'public_profile','email',]);
if (result.isCancelled) {
throw 'User cancelled the login process';
}
const data = await Accesstoken.getCurrentAccesstoken();
if (!data) {
throw 'Something went wrong obtaining access token';
}
const firebaseCredential = await auth.FacebookAuthProvider.credential(
data.accesstoken,);
const fbUserObj = await auth().signInWithCredential(firebaseCredential);
} catch (error) {
if (error.code === 'auth/account-exists-with-different-credential') {
Alert.alert('Email already registered');
} else if (error.code === statusCodes.SIGN_IN_CANCELLED) {
Alert.alert('Sign in cancelled');
} else if (error.code === statusCodes.IN_PROGRESS) {
Alert.alert('Sign in is already in progress');
} else {
Alert.alert('Issue creating account',error.message);
}
}
};
解决方法
您可以将此徽标图片更改为您的 Facebook 开发者应用https://developers.facebook.com/