简体   繁体   English

React-native facebook 登录显示黑屏/白屏

[英]React-native facebook login shows blank screen / white screen

facebook: ~5.0.1 and expo: 33.0.0` facebook:~5.0.1 and expo:33.0.0`

  onFacebookSignIn = async () => {
        try {
            const {
                type,
                token,
            } = await Facebook.logInWithReadPermissionsAsync(facbookAppId, {
                permissions: ['public_profile', 'email'],
                browser: 'browser'
            });
            if (type === 'success') {
                const response = await fetch(`https://graph.facebook.com/me?access_token=${token}`);
                Alert.alert('Logged in!', `Hi ${(await response.json()).name}!`);
            } else {
                console.log('cancel');
            }
        } catch ({ message }) {
            alert(`Facebook Login Error: ${message}`);
        }
    }

**on click of a button it opens facebook login page login via my email and password works fine but in case of login via install facebook app, it takes me to next allow page but than next page show blank:( **点击一个按钮,它会打开 facebook 登录页面通过我的 email 登录,密码可以正常工作,但如果通过安装 facebook 登录应用程序,它需要我进入下一页,但它需要我进入下一页空白:(

i have spent couple of days on this on and off, thankyou.我花了几天时间断断续续,谢谢。 将我的应用程序许可给 facebook 后的空白屏幕 screen屏幕登录页面 ** **

Since Facebook actually opens and you are prompt with the login page then it is most probably that you make a mistake setting up your Facebook app on your Facebook developer account.由于 Facebook 实际打开并且您提示登录页面,那么您很可能在 Facebook 开发人员帐户上设置 Facebook 应用程序时出错。

  1. Follow this to set your Facebook app correctly按照正确设置您的 Facebook 应用程序
  2. Make sure to set host.exp.Exponent for your app field iOS Bundle ID确保为您的应用程序字段设置host.exp.Exponent iOS Bundle ID
  3. Make sure to set rRW++LUjmZZ+58EbN5DVhGAnkX4= for your app field Android key hash确保为您的应用程序字段 Android 键 hash 设置rRW++LUjmZZ+58EbN5DVhGAnkX4=

Please follow this since you are using expo SDK 33请按照操作,因为您使用的是 expo SDK 33

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM