问题描述
我正在使用LoginManager.logInWithPermissions允许用户登录,但是当这是用户首次希望通过fb注册时,不会显示console.log()事件。 这是我的代码:
const continueWithFacebook = () => {
Platform.OS === 'android' && LoginManager.setLoginBehavior('WEB_VIEW_ONLY');
LoginManager.logInWithPermissions(['public_profile','email']).then(
(result: any) => {
console.log('trying to register')
!result.isCancelled &&
Accesstoken.getCurrentAccesstoken().then((data: any) => {
const accesstoken = data.accesstoken.toString();
authApi.loginWithFacebook(
accesstoken,() => {},error => {
if (error.message === 'Authentication fail!') {
requestUserInfos(accesstoken);
}
}
);
});
},() => Toast.show('Erreur lors de la connexion à Facebook',Toast.SHORT)
);
};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)