Developer Docs

iOS Quick Start Guide

This quick start guide will walk you through installing Kamcord; you’ll be recording and sharing a video in just a few minutes.

CocoaPods

If you use Cocoapods, add “pod ‘Kamcord'” to your pod file for effortless installation & integration.

Download and Install the Kamcord Plugin

Download SDK

First download the Kamcord framework and related resources. By downloading Kamcord, you agree to our Developer Terms of Use.

Unzip that file and drag and drop Kamcord.embeddedframework from the unzipped folder:

into your Xcode project:

Make sure to check the box next to the target application you want to link the framework to:

Note: If you want to drag Kamcord.framework instead of Kamcord.embeddedframework into Xcode, make sure to also drag in the Resources folder separately!

Next, make sure your target application has the following frameworks under

Build Phases ==> Link Binary With Libraries:   

  • Accounts (Weak)
  • AdSupport (Weak)
  • AudioToolbox
  • AVFoundation
  • CoreImage (Weak)
  • CoreGraphics
  • CoreMedia
  • CoreText
  • CoreVideo
  • Foundation (Weak)
  • Kamcord
  • MediaPlayer
  • MessageUI
  • OpenGLES
  • QuartzCore
  • Security
  • Social (Weak)
  • SystemConfiguration
  • Twitter (Weak)
  • UIKit (Weak)

 

To gracefully support iOS 4.3 deployment, set the frameworks inside the orange box (see screenshot below) to Optional. This will allow your app to run on devices with iOS 4.3.

OPTIONAL: If you’re using Swift, you can use the Kamcord-Bridging-Header like so:

  1. Add the Kamcord bridging header found in Kamcord.framework/Headers/Kamcord-Bridging-Header.h in to your Xcode project.
  2. Add the complete path to that header file under Build Settings => Objective-C Bridging Header.

That’s all you need to call Kamcord methods from Swift!

Configuration

You will need a unique developer key and secret pair for each game you release with Kamcord.

  1. Import Kamcord into your application delegate:
    #import <Kamcord/Kamcord.h>
  2. Set your developer key, developer secret, app name, and parent view controller when your app initializes.  You should have received your developer key and secret via email after you signed up for Kamcord at http://kamcord.com/signup. Each app should use its own developer key/secret pair. If you plan to integrate Kamcord into more than one app, please login to the developer dashboard and click “Get New Key” from the dropdown menu on the top left corner. Your username/password for the dashboard are your signup email and developer secret, respectively. The developer key, developer secret, and app name parameters are used to track uploads from different apps, so we encourage you to set it correctly.
  3. // Tell Kamcord your developer key, secret, app name,
    // and the parent view controller that will present the Kamcord UI.
    [Kamcord setDeveloperKey:@"My_Developer_Key”
             developerSecret:@"My_Developer_Secret"
                     appName:@"My_Game_Name"
        parentViewController:parentViewController];
  4. If you’re on cocos2d-1.x, set up your window’s rootViewController and CCDirector‘s orientation as follows:
    window.rootViewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
    window.rootViewController.view = glView;
    
    // Use CCDeviceOrientationPortrait or CCDeviceOrientationLandscapeLeft/Right
    [[CCDirector sharedDirector] setDeviceOrientation:...];

    This will allow Kamcord to present the the Kamcord UI when you call [Kamcord showView].

Record and Share a Video

You can get a very simple recording up and running by calling [Kamcord startRecording] as soon as your first scene loads. For example:

// Start recording video
[Kamcord startRecording];

// After 10 seconds, stop recording and show the Kamcord share UI
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, 10e9);
dispatch_after(popTime, dispatch_get_main_queue(), ^(void)
{
    [Kamcord stopRecording];
    [Kamcord showView];
});

This code will record 10 seconds of video and then show the Kamcord share UI after that’s done. This should only be for test purposes and not the way you actually integrate Kamcord into your game’s flow.

Next Section

Features and Settings