我有一个功能:
function loginWithGoogle () {
firebase.auth().signInWithRedirect(provider);
}
firebase.auth().getRedirectResult().then(function(result) {
if (result.credential) {
// This gives you a Google Access Token. You can use it to access the Google API.
var token = result.credential.accessToken;
}
var user = result.user; // The signed-in user info.
}).catch(function(error) {
// Handle Errors here.
var errorCode = error.code;
var errorMessage = error.message;
var email = error.email; // The email of the user's account used.
var credential = error.credential; // The firebase.auth.AuthCredential type that was used.
});
当用户点击登录按钮时运行。但是,这似乎不适用于Safari(使用移动模拟器和我的桌面)。代码在Chrome上正常运行。我还需要添加其他内容以确保支持Safari吗?谢谢!