【问题标题】:url for posting title,description and link in linkedIn在linkedIn中发布标题、描述和链接的网址
【发布时间】:2011-12-03 07:07:01
【问题描述】:

我需要通过我的 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 一样发布标题、描述和网址。

我该怎么做,谁能帮帮我。

【问题讨论】:

    标签: iphone social-networking linkedin


    【解决方案1】:

    我使用sharelink方法解决它。泰国的代码是

    -(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];
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-06-11
      • 2014-05-13
      • 2012-11-16
      • 1970-01-01
      • 2012-02-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多