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.