Skip to content

sharkhack/ShareWithPinterest

Repository files navigation

#iOS Pin It App ANE Project

iOS Pin It SDK for Adobe Air Native Extension

Help people share from your iPhone app. 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.

iOS Pin It SDK

ENJOY! :)

Adobe Air Native Extension Help http://help.adobe.com/en_US/air/build/WS597e5dadb9cc1e0253f7d2fc1311b491071-8000.html

The easiest way to integrate iOs Library is via Xcode. And using ActionScript Mobile Library via Apache Flex SDK.

If you're still living in the Xcode (Objective-C style), add the following files to your project:

  • FlashRuntimeExtension.h
  • Pinterest.Framework
  • ShareWithPinterest.h
  • ShareWithPinterest.m

Using the Pinterest SDK 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.

Add to your project app.xml file as follow;

<application>
        ....
        <iPhone>
                <InfoAdditions>
                        <![CDATA[
                        ....
                        <key>CFBundleURLTypes</key>
                        <array>
                            <dict>
                                <key>CFBundleURLSchemes</key>
                                <array>
                                        <!--
                                        pin<clientid>
                                        Example if your client id is 18571937652947:
                                                pin18571937652947 is the URL Scheme you need to support.
                                        -->
                                   <string>pin18571937652947</string>
                                </array>
                            </dict>
                        </array>
                        .....
                        ]]>
                </InfoAdditions>
                <requestedDisplayResolution>high</requestedDisplayResolution>
        </iPhone>
        <extensions>
                <extensionID>com.azer.iospinterest</extensionID>
        </extensions>
</application>

ActionScript Flex Mobile Library Project functions:

Initializes a Pinterest instance. @param clientId A Pinterest client id. @return Pinterest instance. If pinning is possible via the Pin It SDK on the device.

 PinIt.getInstance().initClientId(PINTEREST_CLIENT_ID);

Crate Pin

 /**
 * createPin
 * 
 * @param imageURL URL of the image to pin.
 * @param sourceURL The source page of the image.
 * @param descriptionText The pin's description.
 * */
PinIt.getInstance().createPin(imageURL,sourceURL,"IMAGE DESCRIPTION HERE");

These classes are ARC enabled, but you can -fobjc-arc them to use in non-ARC projects (not required if you're using Xcode).

About

iOS Pin It SDK for Adobe Air Native Extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages