Search code examples
iosobjective-cxcodesafariinstagram-api

Login Through Instagram App instead of Safari


I need to integrate Instagram login in my app. So I am redirecting to safari in my application to login in Instagram. but what i have to do is, if user have Insta app installed and he/she is already logged in there then the login screen should not come he can directly go to authentication approval.

my Login code is,

- (NSURLRequest *) loginRequest {

    NSString * urlString = [NSString stringWithFormat:@"https://instagram.com/oauth/authorize/?client_id=%@&redirect_uri=%@&response_type=token", self.clientID, self.redirectURI];

    NSURL * url = [NSURL URLWithString:urlString];
    return [NSURLRequest requestWithURL:url];
}

I went through too many questions here but didn't got the answer. its not feasible or what , i am totally confused .


Solution

  • According to instagram official docs

    There are two types of authentication available

    • Client-Side (Implicit) Authentication
    • Server-side (Explicit) Flow

    Both of which uses a instagram end point to login the user in the web page.

    There is no authentication available through their iOS/Android app