我正在尝试通过Firebase身份验证使用Facebook登录。我遵循了整个文档。最后,每当我单击登录按钮时,都会显示错误消息:
Cannot pass a read permission (email) to a request for publish authorization
显示错误的行是:
LoginManager.getInstance().logInWithPublishPermissions(LoginActivity.this,Arrays.asList("email", "public_profile"));
有人可以向我解释我做错了什么吗?我也看过其他答案,但那里没有帮助。
答案 0 :(得分:1)
使用date
代替logInWithReadPermissions
。该错误消息非常清楚,您正在尝试使用用于发布权限的功能来请求读取权限。
答案 1 :(得分:0)
.getInstance().logInWithPublishPermissions
不是Firebase身份验证。通过Firebase JavaScript(web)SDK,可以通过Facebook之类的联合提供程序登录。有关详细信息,请参见Authenticate Using Facebook Login with JavaScript。
firebase.auth().signInWithPopup(provider).then(function(result) { // This gives you a Facebook Access Token. You can use it to access the Facebook API. var token = result.credential.accessToken; // The signed-in user info. var user = result.user; // ... }).catch(function(error) { // Handle Errors here. var errorCode = error.code; var errorMessage = error.message; // The email of the user's account used. var email = error.email; // The firebase.auth.AuthCredential type that was used. var credential = error.credential; // ... });