iOS Pin It SDK

Help people share from your iPhone app.

Updated Decemeber 18th, 2013

Overview

With the launch of Pinterest version 2.3 for iOS, we'll be supporting the Pin It button SDK for your iOS app. This SDK will let your users create Pinterest content inside your app with just a few lines of code. Right now, we only support adding an image from a URL. In the future, we’ll support adding local images.

This SDK requires the Pinterest app to be installed. If version 2.3 or higher of the Pinterest app isn't installed, the Pin It button will redirect the user to the app store to download it. Our app only supports iOS5 and higher.

Using the SDK

Register for a Client ID

Download the documentation and SDK

First place the Pinterest.embeddedframework folder into YOUR_PROJECT you can do this by dragging it under your project in Xcode.

In your application's project settings you will need to add a URL type to support opening your app from the Pinterest app.

    pin<clientid>

    Example if your client id is 18571937652947:
    pin18571937652947 is the URL Scheme you need to support.

To use the Pinterest framework you will need to import it into your file.

    #import <Pinterest/Pinterest.h>

To use the standard PinIt Button in a view add it as so:

    UIButton* pinItButton = [Pinterest pinItButton];
    [pinItButton addTarget:self
                    action:@selector(pinIt:)
          forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:pinItButton];

You will need to handle the action an example of this is below:

    - (void)pinIt:(id)sender
    {
        [_pinterest createPinWithImageURL:@"http://placekitten.com/500/400"
                                sourceURL:@"http://placekitten.com"
                              description:@"Pinning from Pin It Demo"];
    }

Alternatively, you can also create your own UI Element and call the same function.

    [_pinterest createPinWithImageURL:@"http://placekitten.com/500/400"
                            sourceURL:@"http://placekitten.com"
                            description:@"Pinning from Pin It Demo"];

Deep Linking

Pinterest for iOS supports deep linking of Pins, Pinners and boards in two ways. First, when using the Pin It SDK you can open the Pinterest app to a specific Pin, Pinner or board. Another option for developers is to use a URI scheme as seen below.

Pin

pinterest://pin/285063851385287883/

Board

pinterest://board/meaghanror/cats-cats-cats/

User

pinterest://user/carlrice/

What files are included:

  • • The library: Pinterest.embeddedframework
  • • Documentation
  • • The demo project using the SDK's pinit feature: PinItDemo.zip