[TIMOB-23825] Facebook logout is not working for iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2016-08-27T12:42:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | n/a |
Reporter | Mostafizur Rahman |
Assignee | Eric Merriman |
Created | 2016-08-25T13:53:41.000+0000 |
Updated | 2017-03-24T18:57:47.000+0000 |
Description
Hello,
Facebook logout is not working for iOS on following Environment:
SDK: 5.4.0 GA
Appcelerator Command-Line Interface, version 5.4.0
facebook module Version: 5.2
*Test Case:*
var fb = require('facebook');
var win = Ti.UI.createWindow({
title : 'Login/Logout',
backgroundColor : '#fff',
});
var label = Ti.UI.createLabel({
text : 'Logged In = ' + fb.loggedIn,
color : '#000',
font : {
fontSize : 20
},
top : 10,
textAlign : 'center'
});
win.add(label);
fb.addEventListener('login', function(e) {
if (e.success) {
alert('login from uid: ' + e.uid + ', name: ' + JSON.parse(e.data).name);
label.text = 'Logged In = ' + fb.loggedIn;
} else if (e.cancelled) {
// user cancelled
alert('cancelled');
} else {
alert(e.error);
}
});
fb.initialize();
fb.addEventListener('logout', function(e) {
alert('logged out');
label.text = 'Logged In = ' + fb.loggedIn;
});
var loginButton = fb.createLoginButton({
readPermissions : ['email'],
top : 100,
width : 150,
height : 100
});
win.add(loginButton);
win.open();
*Step to reproduce:*
1)Starts the app, click facebook login
2)it redirects to safari, asks for your fb username and password
3)after logging in, logs in the app with fb data
4)Tried to log out, it will trigger Facebook.logout();
5)Repeat step 1 and 2. but this time it wont ask for your username and password, as you already logged into safari. In this case i can't switch to another fb account
See TIMOB-14551 for details on how to clear the cookies using the
Ti.Network.HTTPClient
API. Once again: Facebook does not allow to clear the web-cookies in the *native* logout, since it are two different kind of authorizations (app-based and global). If people want to clear it manually anyway, check the provided API :-)Closing ticket with reference to the previous comments.