【问题标题】:share video on Pinterest在 Pinterest 上分享视频
【发布时间】:2013-06-25 06:13:48
【问题描述】:

我正在开发一个想要在 Pinterest 上分享视频的应用程序。我搜索我找到的图片

https://pinterest-ota-builds.s3.amazonaws.com/PinItDemo.zip

http://developers.pinterest.com/ios/

我下载了框架,框架中只有一个文件可用

Pinterest.h

@interface Pinterest : NSObject

- (id)initWithClientId:(NSString *)clientId;

- (id)initWithClientId:(NSString *)clientId
   urlSchemeSuffix:(NSString *)suffix;

- (BOOL)canPinWithSDK;

- (void)createPinWithImageURL:(NSURL *)imageURL
                sourceURL:(NSURL *)sourceURL
              description:(NSString *)descriptionText;

+ (UIButton *)pinItButton;

@end

没有任何类型的登录和认证方法,没有任何类型的视频分享方法。

我也发现了这个iOS Pin It SDK with no documentation and sample code

我还使用UIWebView 使用它,它在 ImageUrl 中工作正常,不适用于视频或没有 url。

 - (NSString*) generatePinterestHTML {
     NSString *description = @"Post your description here";

     NSString *sUrl = [NSString stringWithFormat:@"http://www.alkalima.com/images/08-02/nature.jpg"];
     NSLog(@"URL:%@", sUrl);
     NSString *protectedUrl = ( NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,( CFStringRef)sUrl, NULL, (CFStringRef)@"!*'\"();:@&=+$,/?%#[]% ",CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
     NSLog(@"Protected URL:%@", protectedUrl);
     NSString *imageUrl = [NSString stringWithFormat:@"\"%@\"", sUrl];
     NSString *buttonUrl = [NSString stringWithFormat:@"\"http://pinterest.com/pin/create/button/?url=www.flor.com&media=%@&description=%@\"", protectedUrl, description];

     NSMutableString *htmlString = [[NSMutableString alloc] initWithCapacity:1000];
     [htmlString appendFormat:@"<html> <body>"];
     [htmlString appendFormat:@"<p align=\"center\"><a href=%@ class=\"pin-it-button\" count-layout=\"horizontal\"><img border=\"0\" src=\"http://assets.pinterest.com/images/PinExt.png\" title=\"Pin It\" /></a></p>", buttonUrl];
     [htmlString appendFormat:@"<p align=\"center\"><img width=\"400px\" height = \"400px\" src=%@></img></p>", imageUrl];
     [htmlString appendFormat:@"<script type=\"text/javascript\" src=\"//assets.pinterest.com/js/pinit.js\"></script>"];
     [htmlString appendFormat:@"</body> </html>"];
     return htmlString;
 }

 - (void) postToPinterest {
     NSString *htmlString = [self generatePinterestHTML];
     NSLog(@"Generated HTML String:%@", htmlString);
     webViewPinterest.backgroundColor = [UIColor clearColor];
     webViewPinterest.opaque = NO;
     if ([webViewPinterest isHidden]) {
         [webViewPinterest setHidden:NO];
     }
     [webViewPinterest loadHTMLString:htmlString baseURL:nil];
 }

请帮我在 Pinterest 上分享视频

【问题讨论】:

    标签: iphone ios objective-c ipad pinterest


    【解决方案1】:

    现在用他们的SDK好像只能分享图片,不能分享视频。

    来自http://developers.pinterest.com/ios/

    目前,我们仅支持从 url 固定图片。在将来, 我们将添加对固定本地图像的支持。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-18
      • 2014-04-09
      • 1970-01-01
      • 2012-04-19
      • 2015-03-15
      • 2014-12-17
      • 2014-04-14
      • 1970-01-01
      相关资源
      最近更新 更多