instagram-ios-sdk icon indicating copy to clipboard operation
instagram-ios-sdk copied to clipboard

Logout !

Open haxinc opened this issue 11 years ago • 15 comments

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

haxinc avatar Nov 10 '13 15:11 haxinc

Look at issue #4

crino avatar Nov 11 '13 06:11 crino

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

haxinc avatar Nov 12 '13 13:11 haxinc

yes, at the moment this is the limit.

crino avatar Nov 12 '13 13:11 crino

Hi Crino..

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

gouravgupta72 avatar Nov 22 '13 05:11 gouravgupta72

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

crino avatar Nov 22 '13 06:11 crino

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

gouravgupta72 avatar Nov 22 '13 06:11 gouravgupta72

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

gouravgupta72 avatar Nov 22 '13 06:11 gouravgupta72

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

i'll do asap

crino avatar Nov 22 '13 07:11 crino

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 :)

gouravgupta72 avatar Nov 22 '13 08:11 gouravgupta72

@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! :)

RyanTLX avatar Jan 21 '14 12:01 RyanTLX

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 avatar Jan 21 '14 17:01 gouravgupta72

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

gouravgupta72 avatar Jan 28 '14 04:01 gouravgupta72

@gouravgupta72 it doesn't work :(

v0l0d avatar Apr 01 '14 18:04 v0l0d

@v0l0d what problem you are facing.?

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

gouravgupta72 avatar May 31 '14 05:05 gouravgupta72

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

Jatindave avatar Nov 25 '15 09:11 Jatindave