Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout ! #31

Open
haxinc opened this issue Nov 10, 2013 · 15 comments
Open

Logout ! #31

haxinc opened this issue Nov 10, 2013 · 15 comments
Labels

Comments

@haxinc
Copy link

haxinc commented Nov 10, 2013

Hi

How to logout not just inside the application, how to login with a new user because it always return to the first login

I think we must clear cookies from Safari

Thanks

@crino
Copy link
Owner

crino commented Nov 11, 2013

Look at issue #4

@haxinc
Copy link
Author

haxinc commented Nov 12, 2013

It works just for UIWebView, if you use this sdk to open in Safari, you can't clear cookies to login with different account.

@crino
Copy link
Owner

crino commented Nov 12, 2013

yes, at the moment this is the limit.

@gouravgupta72
Copy link

Hi Crino..

How can we handle log out functionality on safari.. Is there any way of doing this..?

@crino
Copy link
Owner

crino commented Nov 22, 2013

I din't test yet, let me know if works:

NSURL *url = [NSURL URLWithString:@"https://instagram.com/"];
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSEnumerator *enumerator = [[cookieStorage cookiesForURL:url] objectEnumerator];
NSHTTPCookie *cookie = nil;
while ((cookie = [enumerator nextObject])) {
        [cookieStorage deleteCookie:cookie];
}

If will work i'll include into the SDK

@gouravgupta72
Copy link

i have cheked it, but it doesn't work with safari .

@gouravgupta72
Copy link

Can we use sdk by opening Instagram login page in webView for authentication ?

@crino
Copy link
Owner

crino commented Nov 22, 2013

must be implemented a webview inside the SDK and disable the safary 'flow'

i'll do asap

@gouravgupta72
Copy link

Hi crino

i have used webView and it working fine for me. After doing some modification i'll upload code of that.

Thanks for your help :)

@RyanTLX
Copy link

RyanTLX commented Jan 21, 2014

@gouravgupta72 Hi there, have you uploaded the code anywhere? I would love to know how I can log out, especially using a UIWebView in the application rather than having to switch to Safari. Thanks! :)

@gouravgupta72
Copy link

Hi,

i will upload it soon and provide link to all.

Gourav Gupta,
sent from my BlackBerry.
-----Original Message-----
From: RyanTLX
Sent: 21/01/2014 6:19:16 pm
Subject: Re: [instagram-ios-sdk] Logout ! (#31)

@gouravgupta72 Hi there, have you uploaded the code anywhere? I would love to know how I can log out, especially using a UIWebView in the application rather than having to switch to Safari. Thanks! :)


Reply to this email directly or view it on GitHub:
#31 (comment)

@gouravgupta72
Copy link

Hi,
I had fixed logout issue of instagarm sdk. You can download updated sdk with sample from https://github.com/gouravgupta72/instagramIOSsdk/ link.

Thanks,
Gourav

@v0l0d
Copy link

v0l0d commented Apr 1, 2014

@gouravgupta72
it doesn't work :(

@gouravgupta72
Copy link

@v0l0d what problem you are facing.?

can you explain coz i had tested it and it is working fine.

@Jatindave
Copy link

i had a same problem so i remove all cookie from webview
NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in [storage cookies]) {
[storage deleteCookie:cookie];
}
[[NSUserDefaults standardUserDefaults] synchronize];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants