首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >分享Pinterest视频

分享Pinterest视频
EN

Stack Overflow用户
提问于 2013-06-25 06:13:48
回答 1查看 1.3K关注 0票数 1

我正在开发一个应用程序,希望在Pinterest上分享视频。我搜索所以我找到了图像

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

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

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

代码语言:javascript
运行
复制
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。

代码语言:javascript
运行
复制
 - (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的视频

EN

回答 1

Stack Overflow用户

发布于 2013-08-07 09:39:29

现在看来,您只可以分享图片,而不能与其SDK分享视频。

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

现在,我们只支持从url中固定图像。在未来,我们将增加对固定本地图像的支持。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17290315

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档