This tutorial describes how to create a new application by using the CJGuestCallViewController. This high-level SDK object is useful for demo purposes.
Refer to the requirements in the Developer Guide.
The following steps show how to piece together the application.
This new project should be built from the iOS Empty Application template.
The installation instructions for the SDK can be found in the Developer Guide.
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];
}
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.