FBsdk没有为devices.same代码返回的电子邮件ID工作正常。 Chrome浏览器未在Andriod设备中返回电子邮件。我已经研究了很多问题,但我发现了任何解决方案。我正在使用3.0版本。
function statusChangeCallback(response) {
console.log('statusChangeCallback');
console.log(response);
if (response.status === 'connected') {
loginFB();
} else {
document.getElementById('status').innerHTML = 'Please log ' +
'into this app.';
}}function checkLoginState() {
FB.login(function(response) {
statusChangeCallback(response);
},{scope: 'public_profile,email'}); }window.fbAsyncInit = function() {
FB.init({
appId : '1817426178332917',
cookie : true,
xfbml : true,
version : 'v3.0'
}) }; (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); function loginFB() {
var o, e = document.URL;
y = e.substring(0, e.lastIndexOf("/")),
console.log('Welcome! Fetching your information.... ');
FB.api('/me', {fields: 'email,picture,first_name,last_name,birthday'},function(e) {
console.log('Successful login for: ' + e.name);
document.getElementById('status').innerHTML =
'Thanks for logging in, ' + e.name + '!';
user_email = e.email, alert("Successfulsssssssss login for: " +JSON.stringify(e)),console.log("Successfulsssssssss login for: " + e.name);
var n = "isFBLogin=connected&fbEmail=" + user_email + "&fbNextAction=myAccount";
o = "https:" == window.location.protocol ? "/eCommerceFacebookLoginSec?" : "/eCommerceFacebookLogin?", jQuery.getJSON(o + n, function(o) {
window.location.replace(y + "/main")
})
}); }