我的应用程序突然无法使用facebook插件,尽管它昨天工作得很好,现在我似乎无法登录而只是停止并弹出“请联系此应用程序的制造商并要求他们报告问题#1118578者“
我注意到它甚至没有到达
console.log('Cordova Facebook Connect plugin initialized successfully.');
在cdv-plugin-fb-connect.js的init函数中,换句话说,init本身可能遇到了一些问题。这是init函数BTW
init: function(apiKey, fail) {
// create the fb-root element if it doesn't exist
if (!document.getElementById('fb-root')) {
var elem = document.createElement('div');
elem.id = 'fb-root';
document.body.appendChild(elem);
}
cordova.exec(function() {
var authResponse = JSON.parse(localStorage.getItem('cdv_fb_session') || '{"expiresIn":0}');
if (authResponse && authResponse.expirationTime) {
var nowTime = (new Date()).getTime();
if (authResponse.expirationTime > nowTime) {
// Update expires in information
updatedExpiresIn = Math.floor((authResponse.expirationTime - nowTime) / 1000);
authResponse.expiresIn = updatedExpiresIn;
localStorage.setItem('cdv_fb_session', JSON.stringify(authResponse));
FB.Auth.setAuthResponse(authResponse, 'connected');
}
}
console.log('Cordova Facebook Connect plugin initialized successfully.');
}, (fail?fail:null), 'org.apache.cordova.facebook.Connect', 'init', [apiKey]);
}
我怀疑它与localStorage.getItem('cdv_fb_session')有关,但我真的不知道如何修复它,我正在使用phonegap 2.9.0 FYI