2011-12-03 91 views
1

我需要从我的iphone应用程序发布在linkedIn的墙上。在链接中发布标题,描述和链接的URL

为此,我从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]; 
} 

这是只发布当前状态的代码,但我需要发布标题,描述和URL,如Facebook。

我该如何做到这一点,任何人都可以帮助我。

回答

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]; 
} 
相关问题