2013-06-25 90 views
1

我正在開發一個應用程序,希望在Pinterest上分享視頻。我搜索,所以我找到了圖像在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罰款不用於視頻或無網址。

- (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上

回答

2

分享視頻看來,現在你只能共享圖片,但沒有視頻與他們SDK。

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

現在,我們只支持從URL釘扎的圖像。未來,我們將增加對固定本地圖像的支持。