實際上由於緩存問題持續存在。我們需要清除緩存,當您退出使用下面的代碼,它工作正常
Titanium.Facebook.appid = "XXXXXXXXXXXXXXXXXX";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
var fbButton = Ti.UI.createButton({
top: 68,
width:290,
height:52,
backgroundImage:"images/login/facebook.png"
});
fbButton.addEventListener('click', function() {
if(Titanium.Facebook.loggedIn){
Titanium.Facebook.logout()
return
}
Titanium.Facebook.authorize();
});
Ti.Facebook.addEventListener('login', function(e) {
if (e.success) {
win.close()
} else if (e.error) {
alert(e.error);
} else if (e.cancelled) {
alert("Canceled");
}
});
Titanium.Facebook.addEventListener('logout', function(e) {
var url = 'https://login.facebook.com';
var client = Titanium.Network.createHTTPClient();
client.clearCookies(url);
});