Friday, 2 November 2012

Integrating Pinterest in iOS Application


Pinterest do not provide api's for integration yet.
So in order to achieve it we need to use UIWebView in iOS App.

Follow below steps:
1. Take a UIViewController containing two buttons, one UIWebView.
2. Generate HTML programatically and pass it to loadHTMLString in UIWebView.
3. On touchup-inside of first button, load html string which will open Pinterest in UIWebView.
4. Here pass your custom description and image url which you want to pin.
5. On touchup-inside of second button, close/hide the UIWebView.
















Download Code from here: PinterestiOSIntegration

Above link helped me out.

5 comments:

  1. Great code, thanks! Do you know if it would be possible to pin a file stored in the iOS file system? That is, do a file upload, similar to Pinterest's Add button?

    ReplyDelete
    Replies
    1. I'm interested in this also. Any thoughts on how to pin a file stored in the iOS file system?

      Delete
  2. Someone has created a framework for this...
    http://www.varshylmobile.com/pinterest-framework-for-ios
    Download the sample app, the code is commented nicely..should be no problem.

    ReplyDelete
  3. Thanks This is very interesting, You are a very skilled blogger. I’ve joined your feed and look forward to seeking more of your great post. Also, I’ve shared your website in my social networks!
    website design

    ReplyDelete