Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

How to install GrabKit

pierrotsmnrd edited this page · 10 revisions

This document explains how to use GrabKit in your own project.


Prerequisites

First, be sure you have followed the instructions to run GrabKit's demo application.

This step is necessary to solve some of the dependancies.


Installation

Drag'n'drop GrabKit's xcodeproj in your own project


In your target settings, go to Build Phase -> Target Dependencies -> click on +


Under the "GrabKit" sub project, select "GrabKitLib" and "GrabKitBundle".


In your target settings, go to Build Phase -> link binary with libraries -> click on +


Under the workspace section, select "GrabKitLib.a". Also add the following frameworks :

  • Accounts.framework (for Facebook SDK)
  • AdSupport.framework (for Facebook SDK)
  • AssetsLibrary.framework (for the Device Grabber)
  • CFNetwork.framework (for the FlickR Lib)
  • QuartzCore.framework (for the GrabKitPicker)
  • Security.framework (for the Picasa Lib)
  • Social.framework (for Facebook SDK)
  • SystemConfiguration.framework (for the Picasa Lib)


In your project explorer, find "grabKitBundle.bundle" and drag it to your Target settings -> Build Phase -> Copy Bundle Resources


In your Target settings -> Build Settings, search for "Other linker flags", and add the following values : * -all_load * -ObjC * -lxml2 * -lsqlite3.0


Still in "Build Settings", search for "header search path" and add the following values :

  • $(TARGET_BUILD_DIR)/include/GrabKitLib
  • /usr/include/libxml2


Import the FacebookSDK in your project

As you did when you configured the demo project, drag and drop the FacebookSDK framework into your project.

You can either download it and follow the included informations : https://developers.facebook.com/ios/downloads/


Once you've imported FacebookSDK in your project, drag-and-drop it to your target settings -> Build Phase -> link binary with libraries


In your own appDelegate, add this import :

#import "GrabKit.h"

Try to build. If you have any error, check this procedure again.

If you don't have errors : Congratulations ! Only a few steps left before you can configure your project :)

First, copy the class myGrabKitConfigurator from the demo application to your own project.

( The configuration process will guide you through the customization of this file )

In your AppDelegate, in the AppDelegate:didFinishLaunching: method, add the following :

[GRKConfiguration initializeWithConfiguratorClassName:@"myGrabKitConfigurator"];
// You can also initialize GRKConfiguration with an instance of your configurator :
// [GRKConfiguration initializeWithConfigurator:[ [GRKDemoConfigurator alloc] init]];

Still in your AppDelegate, add the following method :

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {

    BOOL urlHasBeenHandledByDispatcher = [[GRKConnectorsDispatcher sharedInstance] dispatchURLToConnectingServiceConnector:url];

    if ( urlHasBeenHandledByDispatcher  ) return YES;

    // If you have specific URL schemes to handle for you application, 
    //  the GRKConnectorDispatcher won't handle the URL. 
    // Then, you can handle here your own URL schemes.

    return NO;
}

You're done ! :) your project is now ready to be configured !

Something went wrong with that request. Please try again.