I am using pod 'TwitterKit' for twitter login integration. Everything is working fine but the problem is when I Login using the kit, I fill the username and password on the Twitter login webpage in safari, and I get logged in and it gives me username, userID and userEmail. But during log out, if I use
NSString *userID = store.session.userID;
NSLog(@"%@",userID);
[store logOutUserID:userID];
It still keeps the login credentials saved somewhere and you could twitter account logged in in Settings App in iPhone.
So when press the twitter login button again, it shows the credentials of the last login, and provides me with last time login's username and userID but not use email as I haven't authorized the ID again and displays the error:
error: Request failed: unauthorized (401)
what to do?
I ended up resolving my own problem. The device I was testing on was ios 9.0.
As per apple latest updates in iOS 11.0,it ditched the social media accounts from settings app. ultimately resulting in not storing the login credentials in phone's settings app.
But in older devices it is still storing these credential.And when we log in again after logging out,it logs out the session, but doesn't delete the credentials from settings.So next time we log in, It checks if the credentials are present in settings and doesn't allow us to authenticate the login credentials again, ultimately not giving us user's
emailID.