# Quick Start

## Overview

This tutorial describes how to create a new application by using the CJGuestCallViewController. This high-level SDK object is useful for demo purposes.

## Requirements

Refer to the requirements in the Developer Guide.

## Steps

The following steps show how to piece together the application.

1. Create A New Project

   This new project should be built from the iOS Empty Application template.

   1. Open Xcode.
   2. From the File menu, select New and then New Project. A new window appears.
   3. From the iOS section, select Application, select Empty Application, and then click Next.
   4. On the next window:
      1. Enter a Product Name and Company Identifier.
      2. Enter a Class Prefix of CJS.
      3. From the Device Family pop-up menu, select Universal.
      4. Uncheck all check boxes.
      5. Click Next.
      6. Navigate to the folder you want your project created in and click Create.
2. Add the SDK to Your Project

The installation instructions for the SDK can be found in the Developer Guide.

3. Add CJGuestCallViewController

In CJSAppDelegate.m, modify `application:didFinishLaunchingWithOptions:` to create an instance of CJGuestCallViewController, set it with your specific server and uri values, and show it.

    #import <JabberGuest/JabberGuest.h>

    @implementation CJSAppDelegate {
        CJGuestCallViewController * jabberGuestController;
    }

    - (BOOL)application:(UIApplication *)didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

        jabberGuestController = [[CJGuestCallViewController alloc] init];

        jabberGuestController.serverName = @"YOUR_SERVER";
        jabberGuestController.toURI = @"YOUR_ADDRESS";

        UINavigationController * navController = [[UINavigationController alloc] initWithRootViewController:jabberGuestController];

        [[self window] setRootViewController:navController];

        [self.window makeKeyAndVisible];
        return YES;
    }

In CJSAppDelegate.m, modify `applicationDidEnterBackground:` to have CJGuestCallViewController handle background transitions.

    - (void)applicationDidEnterBackground:(UIApplication *)application
    {
        [jabberGuestController enterBackground];
    }

In CJSAppDelegate.m, modify `applicationWillEnterForeground:` to have CJGuestCallViewController handle foreground transitions.

    - (void)applicationWillEnterForeground:(UIApplication *)application
    {
        [jabberGuestController enterForeground];
    }

In CJSAppDelegate.m, modify `applicationWillTerminate:` to have CJGuestCallViewController handle the application terminating.

    - (void)applicationWillTerminate:(UIApplication *)application
    {
        [jabberGuestController terminate];
    }

4. Build and Run the Application

   Build and run the application on your iOS device. You should be able to play a video call to the URI you set in the `application: didFinishLaunchingWithOptions:` method.