tdip09 tdip09 - 2 years ago 107
iOS Question

After signing into Instagram in my iOS app how can I sign in as a different user?

So I am building an

with instagram integration. I registered my app with instagram and have everything working so far. When the user clicks the ADD ACCOUNT button, I load the instagram auth url ( into a webview and the instagram login page appears.

I can then successfully login, my redirect then redirects correctly, and I can then exchange the code for an access token, close the webview, and display an alert saying that login was successful. But when the user clicks the ADD ACCOUNT button again and the webview loads the auth url, instead of seeing the instagram login page, it automatically authorizes and the successful login alert appears.

Is the webview caching something? How would I prevent this?

Answer Source

try clear caches and cookies

clear caches:

[[NSURLCache sharedURLCache] removeAllCachedResponses];

to remove cookies check those two questions:

How to delete all cookies of UIWebView?

Delete cookies UIWebView

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download