Getting Started

The iOS SDK is an incredibly simple white-labeled solution to sell printed products entirely in your iPhone/iPad application. The entire transaction takes place seamlessly within your application, and we never use/reuse/share your customer data.

We also offer a lightweight version of our SDK for people looking mainly for API access.

In order to get started with the SDK, you need to get an API key (which we call RecipeId). This can be obtained by signing up.

Add Gooten SDK to your project (CocoaPods)

  1. Open a terminal window, and $ cd into your project directory.
  2. Create a Podfile. This can be done by running $ pod init.
  3. Open your Podfile and add a CocoaPod by specifying pod ‘PrintIO’ on a single line inside your target block.
    target 'MyProject' do
     pod 'PrintIO'
    end
    
  4. Save your Podfile and run $ pod install.

Add Gooten SDK to your project (manually from Git)

  1. From releases download latest release Source code (zip)
  2. Unzip it, and drag PrintIO.framework, PrintIOBundle.bundle and TextBundle.bundle to your project
  3. Select target -> Build Settings -> Framework Search Paths and add path to folder where PrintIO framework is
  4. Select target -> Build Phases -> Link Binary With Libraries and add libraries libc++, libsqlite3 and libxml2
  5. Select target -> Build Settings -> Other Linker Flags and add -all_load
  6. To run sdk on real devices: Select Target -> Build Settings -> Enable Bitcode set to No

Quick Launch Code

Example code for launching Gooten SDK from view controller (below is sample recipeId, you can provide recipeId from Gooten):

// Objective C
#import <PrintIO/PrintIO.h>

- (void)viewDidLoad {
    [super viewDidLoad];

    PrintIO *printIO = [[PrintIO alloc]initWithViewController:self
                                                     recipeId:@"<INSERT YOUR RECIPE ID HERE>"
                                                 isInTestMode:YES]; // in testing mode orders are submitted without payment verification
    [printIO open];
}

In Swift, first put #import <PrintIO/PrintIO.h> into -Bridging-Header.h.

// Swift
override func viewDidLoad() {
    super.viewDidLoad()

    let printIO = PrintIO(viewController: self, recipeId: "<INSERT YOUR RECIPE ID HERE>", isInTestMode: true);
    printIO.open();
}

iOS 9 and XCode 7 support:

If you have problem with loading images, please use temporary solution for this issue: In Info.plist under Information Property List add NSAppTransportSecurity, and under NSAppTransportSecurity add NSAllowsArbitraryLoads and set it to YES.

After launching SDK, you should get this screen: