我正在尝试通过SDK提取LinkedIn会话,但它始终返回nil
。我获得了成功认证,但会话对象始终为nil
。我该如何解决?
[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];
}
];