2011-12-03 19 views
1

私のiPhoneアプリケーションからlinkedInの壁に投稿する必要があります。タイトル、説明、リンク先のリンク先

私はthe sourceからコードをダウンロードしています。壁コード上の投稿のためのこの

- (RDLinkedInConnectionID *)updateStatus:(NSString *)newStatus { 
    NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/v1/people/~/current-status"]]; 
    newStatus = [newStatus length] > kRDLinkedInMaxStatusLength ? [newStatus substringToIndex:kRDLinkedInMaxStatusLength] : newStatus; 
    NSData* body = [RDLinkedInRequestBuilder buildSimpleRequestWithRootNode:@"current-status" content:newStatus]; 
    return [self sendAPIRequestWithURL:url HTTPMethod:@"PUT" body:body]; 
} 

でこれが唯一の現在のステータスを投稿するためのコードですが、私はFacebookのようなタイトル、説明、URLを投稿する必要があります。

どのように私はこれを行うことができます、いずれかが私を助けてください。

答えて

0

私はタイ人のためのsharelink method.Codeを使用して、それを解決する

-(RDLinkedInConnectionID *)shareLink:(NSDictionary *)shareDict { 
    NSURL* url = [NSURL URLWithString:[kAPIBaseURL stringByAppendingString:@"/v1/people/~/shares"]]; 
    NSString *xmlStr = [NSString stringWithFormat:@"<share><content><title>%@</title><submitted-url>%@</submitted-url><description>%@</description></content><visibility><code>anyone</code></visibility></share>",[shareDict objectForKey:@"Title"],[shareDict objectForKey:@"Link"],[[shareDict objectForKey:@"Description"]substringWithRange:NSMakeRange(0,150)]]; 
    NSData* body = [xmlStr dataUsingEncoding:NSUTF8StringEncoding]; 
    return [self sendAPIRequestWithURL:url HTTPMethod:@"POST" body:body]; 
} 
です
関連する問題