TheDeveloper
TheDeveloper

Reputation: 1217

Xamarin iOS : Facebook logout issue

I am using Xamarin.Facebook.iOS SDK (v 4.13.1.0) for Facebook login.

Current scenario: In my app, once user logs in through Facebook credentials and logs out, he can just hit login and get authenticated.

Expected Scenario: Once user logs in through Facebook credentials and logs out, if he wants to login again, he needs to enter his Facebook is and password once again.

Right now for log out I am using the following code:

NSHttpCookieStorage storage = NSHttpCookieStorage.SharedStorage;
            foreach (NSHttpCookie cookie in storage.Cookies) 
            {
                if(cookie.Domain == ".facebook.com")
                {
                    storage.DeleteCookie(cookie);
                }
        }

But this doesn't work. Right now, to get the expected result I have to:

  1. Sign out and close app, then Open Safari and clear history.
  2. Sign out and close app, then Open Safari -> goto Facebook website ( it won't ask for credentials as it was has when we logged in it from our app) and logout.

Clearly, its not the best way to get the desired result. Can anyone please advise me a better approach ??

Also, Is there any way I could set expiry date for the Facebook access token that way i could set the expiry date to current date time and let user enter his credentials again next time they login.

Thank you.

Upvotes: 2

Views: 604

Answers (1)

aimapple
aimapple

Reputation: 36

I upgraded the iPhone with iOS 10.1.1 and now the logout work correctly.

Upvotes: 2

Related Questions