我正在使用以下代码
- (void)linkedInEngineAccessToken:(RDLinkedInEngine *)engine setAccessToken:(OAToken *)token {
if( token ) {
[token rd_storeInUserDefaultsWithServiceProviderName:@"LinkedIn" prefix:@"My app name"];
}
else {
[OAToken rd_clearUserDefaultsUsingServiceProviderName:@"LinkedIn" prefix:@"My App name"];
}
}
- (OAToken *)linkedInEngineAccessToken:(RDLinkedInEngine *)engine {
return [OAToken rd_tokenWithUserDefaultsUsingServiceProviderName:@"LinkedIn" prefix:@"My app name"];
}
- (void)linkedInEngine:(RDLinkedInEngine *)engine requestSucceeded:(RDLinkedInConnectionID *)identifier withResults:(id)results {
NSLog(@"++ LinkedIn engine reports success for connection %@\n%@", identifier, results);
if( identifier == self.fetchConnection ) {
// NSDictionary* profile = results;
}
}
- (void)linkedInEngine:(RDLinkedInEngine *)engine requestFailed:(RDLinkedInConnectionID *)identifier withError:(NSError *)error {
NSLog(@"++ LinkedIn engine reports failure for connection %@\n%@", identifier, [error localizedDescription]);
}
- (void)fetchProfile {
self.fetchConnection = [self.engine profileForCurrentUser];
[self.engine updateStatus:@"Download app from the #Apple #AppStore and #Android #GooglePlay market."];
[self dismissModalViewControllerAnimated:YES];
}
#pragma mark - RDLinkedInAuthorizationControllerDelegate
- (void)linkedInAuthorizationControllerSucceeded:(RDLinkedInAuthorizationController *)controller {
[self fetchProfile];
}
- (void)linkedInAuthorizationControllerFailed:(RDLinkedInAuthorizationController *)controller {
}
- (void)linkedInAuthorizationControllerCanceled:(RDLinkedInAuthorizationController *)controller {
}
@end
我已经正确设置了东西。它需要我到linkedIn登录页面,登录后授予权限我收到此错误
无法加载页面错误域=NSURLErrorDomain 代码=-1003“找不到具有指定主机名的服务器。” UserInfo=0x81e2250 {NSErrorFailingURLStringKey=http://www.devbee.ca/?oauth_token=MY_TOKEN&oauth_verifier=VERIFIER, NSErrorFailingURLKey=MY_REDIRECT_URL/?oauth_token=MY_OAUTH_TOKEN&oauth_verifier=MY_VERIFIER, NSLocalizedDescription=找不到指定主机名的服务器。, NSUnderlyError= 0x810ddc0 "找不到指定主机名的服务器。"}
怎么了?
是不是因为
- (OAToken *)linkedInEngineAccessToken:(RDLinkedInEngine *)engine {
return [OAToken rd_tokenWithUserDefaultsUsingServiceProviderName:@"LinkedIn" prefix:@"My app name"];
}