2013-05-03 62 views
0

我試圖更新LinkedIn的Objective-C庫 https://github.com/synedra/LinkedIn-OAuth-Sample-ClientLinkedIn的Objective-C庫範圍內的電子郵件地址

允許電子郵件地址的檢索。

我該怎麼做?

我試圖改變

OARequestParameter *nameParam = [[OARequestParameter alloc] initWithName:@"scope" 
                    value:@"r_fullprofile r_contactinfo r_emailaddress"]; 
NSArray *params = [NSArray arrayWithObjects:nameParam, nil]; 
[request setParameters:params]; 
OARequestParameter * scopeParameter=[OARequestParameter requestParameter:@"scope" value:@"r_fullprofile r_contactinfo r_emailaddress"]; 

[request setParameters:[NSArray arrayWithObject:scopeParameter]]; 

,但不工作

回答

0

你不需要做所有這些東西,只需在任何你想你的應用程序設置中選擇您所需的範圍。保持代碼簡單如下。在登錄視圖中鏈接會自動顯示您所有選擇的範圍。

- (void)requestTokenFromProvider 
    { 

     OAMutableURLRequest *request = 
       [[[OAMutableURLRequest alloc] initWithURL:requestTokenURL 
               consumer:self.consumer 
                token:nil 
               callback:linkedInCallbackURL 
             signatureProvider:nil] autorelease]; 

     [request setHTTPMethod:@"POST"]; 

     OADataFetcher *fetcher = [[[OADataFetcher alloc] init] autorelease]; 
     [fetcher fetchDataWithRequest:request 
          delegate:self 
        didFinishSelector:@selector(requestTokenResult:didFinish:) 
         didFailSelector:@selector(requestTokenResult:didFail:)]; 

    } 
相關問題