Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegrating Pinterest with my iOS app
    text
    copied!<p>I want to post an image on to pinterest account from my iPhone application, there is no any API release from pinterest thats why i am trying to integrate it with URL Scheme but didn't get successed on it. Here is the code for it, </p> <pre><code>- (void)pinThroughURLScheme { NSString *urlString = PinterestURLMake(self.image, nil, @"alt", @"image.jpeg", NO); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; } NSString *PinterestURLMake(UIImage *image, NSString *urlString, NSString *alt, NSString *title, BOOL isVideo) { NSString *base64ImageString = [NSString stringWithFormat:@"data:image/png;base64,%@", NSStringFromUIImage(image)]; NSString *encodedBase64ImageString = [base64ImageString urlEncodeUsingEncoding:NSUTF8StringEncoding]; NSString *encodedURLValue = [urlString urlEncodeUsingEncoding:NSUTF8StringEncoding]; NSString *encodedAltValue = [alt urlEncodeUsingEncoding:NSUTF8StringEncoding]; NSString *encodedTitleValue = [[NSString stringWithFormat:@"%@ %.0fx%.0f pixels", title, image.size.width, image.size.height] urlEncodeUsingEncoding:NSUTF8StringEncoding]; NSString *videoValue = isVideo ? @"true" : @"false"; return [NSString stringWithFormat:@"pinterest://pin/create/bookmarklet/?url=URL-OF-THE-PAGE-TO-PIN&amp;media=URL-OF-THE-IMAGE-TO-PIN&amp;description=ENTER-YOUR-DESCRIPTION-FOR-THE-PIN", encodedBase64ImageString, urlString ? [NSString stringWithFormat:@"&amp;url=%@", encodedURLValue] : @"", alt ? [NSString stringWithFormat:@"&amp;alt=%@", encodedAltValue] : @"", title ? [NSString stringWithFormat:@"&amp;title=%@", encodedTitleValue] : @"", videoValue]; } </code></pre> <p>After running this code, didn't get any response from my iPhone device.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload