我正在开发希望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版别起来SDK没有文档和示例代码
我也用这个利用UIWebView
,其工作罚款的ImageUrl没有视频或没有网址。
- (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上分享视频