2017-09-19 6 views
1

Ich muss eine Autorisierung mit LinkedIn für meine App bereitstellen. ich meine App dieses Tutorial auf: https://developer.linkedin.com/docs/ios-sdk Dann Versuchen Sie es mit dieser Methode um sich einzuloggen:iOS Anmeldung mit LinkedIn SDK

- (void)login:(UIViewController *)controller{ 
NSArray *permissions = [NSArray arrayWithObjects:LISDK_BASIC_PROFILE_PERMISSION, LISDK_EMAILADDRESS_PERMISSION, LISDK_W_SHARE_PERMISSION, nil]; 
[LISDKSessionManager createSessionWithAuth:permissions state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState) { 
    LISDKSession *session = [[LISDKSessionManager sharedInstance] session]; 
    NSLog(@"Session LINKEDIN: %@", session.description); 
    NSString *url = [NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~"]; 
    if ([LISDKSessionManager hasValidSession]) { 
    [[LISDKAPIHelper sharedInstance] getRequest:url 
             success:^(LISDKAPIResponse *response) { 
      NSData* data = [response.data dataUsingEncoding:NSUTF8StringEncoding]; 
      NSDictionary *dictResponse = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil]; 
      NSLog(@"Authenticated user name : %@ %@", [dictResponse valueForKey: @"firstName"], [dictResponse valueForKey: @"lastName"]); 
     } error:^(LISDKAPIError *apiError) { 
      NSLog(@"Error : %@", apiError); 
     }]; 
    } 
} errorBlock:^(NSError *error) { 
    NSLog(@"%s","error called!"); 
}]; 

}

Meine App erfordert zu öffnen LinkedIn App, wenn ich dort Login meine LI eingeben und Passwort, es fordert mich auf, meine Berechtigungen zu bestätigen, aber dann passiert nichts. Was kann ich tun, um eine korrekte Autorisierung über LinkedIn durchzuführen? (vielleicht gibt es eine Möglichkeit, dies mit WebView als FB oder Twitter zu tun?) Danke.

Antwort

1

herausgefunden, wie Token OAuth zu erhalten. Just all das Zeug gefolgt von dieser tutorial!

Verwandte Themen