LinkedIn ios SDK - user authentication, if user chooses not to download the mobile app from app store
Asked Answered
A

0

10

I am trying to integrate linked-ios-sdk for user authentication in my app by following steps provided in this link: Authenticating with the Mobile SDK. In the provided sample app they are using this code:

[LISDKSessionManager createSessionWithAuth:[NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, nil]
                                     state:@"some state"
                                     showGoToAppStoreDialog:YES
                                               successBlock:^(NSString *returnState) {

                                                   NSLog(@"%s","success called!");
                                                   LISDKSession *session = [[LISDKSessionManager sharedInstance] session];
                                                   NSLog(@"value=%@ isvalid=%@",[session value],[session isValid] ? @"YES" : @"NO");
                                                   NSMutableString *text = [[NSMutableString alloc] initWithString:[session.accessToken description]];
                                                   [text appendString:[NSString stringWithFormat:@",state=\"%@\"",returnState]];
                                                   NSLog(@"Response label text %@",text);
                                                   _responseLabel.text = text;
                                                   self.lastError = nil;
                                                   // retain cycle here?
                                                   [self updateControlsWithResponseLabel:NO];

                                               }
                                                 errorBlock:^(NSError *error) {
                                                     NSLog(@"%s %@","error called! ", [error description]);
                                                     self.lastError = error;
                                                     //  _responseLabel.text = [error description];
                                                     [self updateControlsWithResponseLabel:YES];
                                                 }

Seems like the only way to authenticate user is by forcing him to download the mobile app from app store. If user chooses 'No' on shown 'Download LinkedIn App' alert view program counter reaches errorBlock showing below error:

error called! Error Domain=LISDKAuthError Code=3 "The operation couldn’t be completed. (LISDKAuthError error 3.)" UserInfo=0x7f8638488450 {You need to download the LinkedIn App in order to connect with LinkedIn=info}

To handle this scenario is it permissible to invoke related oauth API from the app or use an open source solution such as - IOSLinkedInAPI which seems like a wrapper for those API. Please suggest.

Affecting answered 10/9, 2015 at 8:44 Comment(1)
Did you figure out a way to do it?Unhallowed

© 2022 - 2024 — McMap. All rights reserved.