本文介绍了在Pinterest上分享视频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am developing an application that want to share video on Pinterest. I search on SO i found for image

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

and I download the framework, in frame work only one file is available

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

没有任何类型的登录和身份验证方法,没有任何类型的视频共享方法。

There is no any type of method for login and authentication, No any type of method for video sharing.

我也发现这个

我也用过这个使用 UIWebView 及其在ImageUrl中的正常工作不适用于视频或没有网址。

I also used this using UIWebView and its working fine in ImageUrl not for video or without 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上分享视频

please help me for sharing video on Pinterest

推荐答案

似乎现在你只能与他们分享图片,但不能与他们分享视频。

It seems that now you can share only the pictures, but not video with they SDK.

来自:

这篇关于在Pinterest上分享视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 12:33