Tag Archive for 'shareKit'

Basic ShareKit customization

ShareKit is an open source framework for iOS apps to add capabilities to share information with many internet services.

Your app can share information with this supported services: Delicious, Email, Facebook, Google Reader, Instapaper, Pinboard, Read It Later, Tumblr, Twitter.

ShareKit has your own interface to connect with the services, but you can customize Sharekit to connect those services in your own way. Let get start our step-by-step tutorial.

1) Create your project.

a. Enter in xcode and create a new project with “view-based application” template;
b. Name the project as “SharekitTest”;
c. Place a UIButton in the SharekiTestViewController.xib;

d. Control-drag the UIButton to the location in the SharekiTestViewController.h you want. When you release the mouse button, Xcode displays a small dialog. Set the connection field to “Action” and the name field to “facebookButtonTapped”

e. Save your project.

2) Add Sharekit to your app

a. Take a look at http://getsharekit.com/install
b. Follow steps 1 and 2 and get back to this tutorial

3) Register your app to developer’s service site.

a. Register your app to http://www.facebook.com/developers, login with your account;
b. Fill the form with your app’s information;
c. You should have consumer key and consumer secret now.

4) Locate and open the file SHKConfig.h an fill the key and secret.
// Facebook - http://www.facebook.com/developers
// If SHKFacebookUseSessionProxy is enabled then SHKFacebookSecret is ignored and should be left blank

#define SHKFacebookUseSessionProxy  NO
#define SHKFacebookKey				@"248989898989898849"
#define SHKFacebookSecret			@"7a6242232323232323236b4997138b1c"
#define SHKFacebookSessionProxyURL  @""
5) Import the headers in the SharekiTestViewController.h
#import "SHK.h"
#import "SHKFacebook.h"
6) Insert the code below in the “FacebookButtonTapped” method in SharekiTestViewController.m to share what you want.
- (IBAction)FacebookButtonTapped:(id)sender {
    SHKItem *item;
    NSURL *url = [NSURL URLWithString:@""http://www.gazapps.com""];
    item = [SHKItem URL:url title:@"Checkout this site"];
    [SHKFacebook shareItem:item];

In this code we create an SHKItem. It has four methods, one for each information you want to share: URL, Images, Text and Files. Then we create an url, set the url to the SHKItem and finally set the item to shareItem method to be published.

It’s done ! You can do a lot more customizations, go to the sharekit website and have fun!

Premium Wordpress Plugin