crino / instagram-ios-sdk

Instagram SDK for iOS
http://www.followgram.me
228 stars 63 forks source link

Logout ! #31

Open haxinc opened 10 years ago

haxinc commented 10 years ago

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 commented 10 years ago

Look at issue #4

haxinc commented 10 years ago

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 commented 10 years ago

yes, at the moment this is the limit.

gouravgupta72 commented 10 years ago

Hi Crino..

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

crino commented 10 years ago

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 commented 10 years ago

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

gouravgupta72 commented 10 years ago

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

crino commented 10 years ago

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

i'll do asap

gouravgupta72 commented 10 years ago

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 commented 10 years ago

@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 commented 10 years ago

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: https://github.com/crino/instagram-ios-sdk/issues/31#issuecomment-32871015

gouravgupta72 commented 10 years ago

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 commented 10 years ago

@gouravgupta72 it doesn't work :(

gouravgupta72 commented 10 years ago

@v0l0d what problem you are facing.?

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

Jatindave commented 8 years ago

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];