反对原生的Facebook权限不起作用

时间:2017-07-01 07:24:47

标签: android facebook react-native react-native-fbsdk

我要求faceboook拥有user_birthdayuser_likes的权限。它已获得 facebook 的批准,我已在 facebook 登录react-native上添加了这些权限

像那样:

onLogin = async () => {
    try {
        this.setState({
            animating: true,
            error: null
        });
        const result = await LoginManager.logInWithReadPermissions(['public_profile', 'email', 'user_birthday', 'user_likes']);
        if (result.isCancelled) {
            throw new Error('Please sign in before continue');
        }
        const tokenData = await AccessToken.getCurrentAccessToken();
        const token = tokenData.accessToken.toString();
        const credential = firebase.auth.FacebookAuthProvider.credential(token);
        const user = await firebase.auth().signInWithCredential(credential);
        this.setState({
            animating: false,
            error: null
        });
        console.log(user)
        this.props.loginSuccess(user);
    } catch (error) {
        this.setState({
            animating: false,
            error: error.message
        });
    }
}

我的问题一切正常(在facebook登录时,facebook说我的应用程序上添加了2个新闻权限以供接受)。但在我的console.log(user)上,我看不到用户birth_dateuser_likes我只有providerData基本信息。

PS:我使用react-native-fbsdk

PS2如果我添加:

alert('Login success with permissions: '
 +result.grantedPermissions.toString());

他说:

Login success with permissions: public_profile,user_birthday,email,user_likes

0 个答案:

没有答案