How to sign out from instagram api in iOS?

how to log out of instagram account that is remembered
how to log out of instagram on all devices
how to log out of instagram on computer
instagram log in
how to log out of instagram 2019
how to log out of instagram on desktop
how to log out of instagram on iphone
how to log out of instagram on other devices

The instagram integration and login has been done. How to sign out from instagram api in iOS? How to remove the access token?


You can logout the user by deleting the cookies.

   let cookieJar : NSHTTPCookieStorage = NSHTTPCookieStorage.sharedHTTPCookieStorage()
    for cookie in cookieJar.cookies! as [NSHTTPCookie]{
        NSLog("cookie.domain = %@", cookie.domain)

        if cookie.domain == "www.instagram.com" ||
            cookie.domain == "api.instagram.com"{

            cookieJar.deleteCookie(cookie)
        }
    }

How to sign out from instagram api in iOS?, The Instagram API uses the OAuth 2.0 protocol for simple, but effective authentication and authorization. If the user is not logged in, they will be asked to log in. You cannot replicate the core user experience of the Instagram apps or web site. For example, do not build a media viewer. You cannot use the API Platform to crawl or store users' media without their express consent. Do not abuse the API Platform, automate requests, or encourage unauthentic behavior. This will get your access turned off.


The following is what we use. Note that the domain has to be ".instagram.com" not "www.instagram.com" since some cookies do not have the "www". Also the main cookie is "sessionid".

 override func signOut() {
    if let cookies = HTTPCookieStorage.shared.cookies {
        for cookie in cookies {
            if cookie.domain.contains(".instagram.com") {
                HTTPCookieStorage.shared.deleteCookie(cookie)
            }
        }
    }
 }

Instagram Developer Documentation, Go to your profile and tap . Tap Settings. Scroll down to Logins. Tap Add account to add login information for a new Instagram account or Log out [username]  Once selected, the intent will launch the Instagram app and pass it your content, which the Instagram App will then load in the Feed Composer. In general, your sharing flow should: Instantiate an implicit intent with the content you want to pass to the Instagram app.


Try this code

InstagramEngine.shared().logout()

How do I add or remove Instagram login information on my device , March 30, 2020 Update: We understand these are challenging times for our developer community, so we are postponing disabling the Instagram Legacy API​  how to sign out instagram on mobile app/browser,how to logout from instagram account,how to logout instagram account,signing out from instagram account.


API, You can now add up to 5 Instagram accounts and quickly switch between them without having to log out and log back in. This is included on version 7.15 for iOS​  Please login to your existing Instagram account to get started. To create an Instagram account, please register using the Instagram app on iPhone or Android. If you are not able to do so, please email a 2-3 line description of your intended use of the Instagram API to developer-signup at instagram.com.


Add and Switch Between Multiple Accounts, This document explains how to successfully call the Instagram Graph API with your app and get an Instagram Business or Creator Account's media objects. Instagram on the Web Tap or click in the top right. Tap or click to the right of your username then select Log Out.


Getting Started - Instagram Platform, In order to work with the Instagram API, sooner or later, you must find your way through the Watch out for old docs! Before you can do anything with the Instagram API you will need to register an API client as a developer. Instagram on the Web. Tap or click in the top right. Tap or click to the right of your username then select Log Out. iPhone or Android. Go to your profile and tap . Tap Settings. Scroll to the bottom of the page and tap Log Out [username]. Tap Not Now or Remember if you want Instagram to remember your login info. Tap Log Out.