Get Started

Clone the code repository from https://github.com/SymphonyOSF/SIOS-Shared

The easiest way to start with the iOS Framework is to build the sample project.

Build and run the FrameworkDemo.xcodeproj located at <SIOS-Shared>/Framework/FrameworkDemo

The FrameworkDemo provides a bare-bones shell application which configures and launches the Symphony application.

Your main interface to the application is through the shared instance of BBAppDelegate.

When accessing the BBAppDelegate use the shared instance, rather than instantiating your own copy.

Your application must pass calls from the UIApplication to the UIApplicationDelegate callbacks which the shared instance of BBAppDelegate implements. It is essential that the shared instance of BBAppDelegate gets a chance to process these messages.

See BBAppDelegate for the complete list of UIApplicationDelegate methods that are required.

The first call that BBAppDelegate is expecting is from the application:didFinishLaunchingWithOptions: method. It is before calling this method that you have the opportunity to configure the Symphony application. There are several settings that you can configure such as enabling copy/paste or attaching photos to messages sent. You configure the application by through the BBApplicationLaunchParameters that you pass to the BBAppDelegate through the NSDictionary passed through application:didFinishLaunchingWithOptions:.

Getting the Symphony application up and running can be as simple as:

After you've setup the BBAppDelegate and called application:didFinishLaunchingWithOptions: (as a part of your app delegate processing this same call), your app delegate should continue to forward the UIApplicationDelegate calls to the shared instance of the BBAppDelegate.

Bare Minimum Configuration
Bare Minimum Configuration
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
BBApplicationLaunchParameters *applicationLaunchParameters = [[BBApplicationLaunchParameters alloc] init];
NSDictionary *applicationLaunchOptions = [NSMutableDictionary dictionaryWithDictionary:launchOptions];
[applicationLaunchOptions setValue:applicationLaunchParameters forKey:BBApplicationParameters];
return [[BBAppDelegate sharedInstance] application:application didFinishLaunchingWithOptions:applicationLaunchOptions];
}

In the demo application, the UIApplicationDelegate class to the UIApplication (FDAppDelegate) does all of the interaction with the BBAppDelegate. The reason for this is that BBAppDelegate needs to process many of the calls that come into the UIApplicationDelegate. You are expected to pass along these calls and their parameters to the BBAppDelegate:

UIApplicationDelegate pass through
UIApplicationDelegate pass through
- (void)applicationWillResignActive:(UIApplication *)application
{
[[BBAppDelegate sharedInstance] applicationWillResignActive:application];
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[[BBAppDelegate sharedInstance] applicationDidEnterBackground:application];
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[[BBAppDelegate sharedInstance] applicationWillEnterForeground:application];
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
[[BBAppDelegate sharedInstance] applicationDidBecomeActive:application];
}
- (void)applicationWillTerminate:(UIApplication *)application
{
[[BBAppDelegate sharedInstance] applicationWillTerminate:application];
}
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
{
[[BBAppDelegate sharedInstance] application:application didReceiveRemoteNotification:userInfo];
}
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
[[BBAppDelegate sharedInstance] application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}
- (void)application:(UIApplication*)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
[[BBAppDelegate sharedInstance] application:application didFailToRegisterForRemoteNotificationsWithError:error];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [[BBAppDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation];
}

Securing NSUserDefaults

The framework stores some preference-like information in a data store that conforms to the BBAbstractDataStore protocol. You may want to set your own data store so you can secure these preference values.

Setting up the BBAbstractDataStore
Setting up the BBAbstractDataStore
[BBDataContainer setDefaultDataStore:[MySecureUserDefaults standardUserDefaults]];

This should be done before your first call to the BBAppDelegate.

Securing File IO

The framework uses BBFileManager.framework for all of its file access, apart from database access. You could either create a replacement BBFileManager framework, exposing all the same public classes and deliver this replacement instead of the default BBFileManager, or you could implement a few key classes and register them with BBFileManagerHelper.

Setting up BBFileManagerHelper
Setting up BBFileManagerHelper
[BBFileManagerHelper registerClassForFileManager:[MySecureFileManager class]];
[BBFileManagerHelper registerClassForFileHandle:[MySecureFileHandle class]];

This should be done before your first call to the BBAppDelegate.

Securing the Database

API Change

Starting on version 1.57.0 it's no longer possible to register custom database integrations.

Securing Network Access

The framework uses NSURLConnection and NSURLSession objects for all networking. You could register custom protocol handlers to intercept the framework's NSURLConnection and NSURLSession requests. This method is how many popular MDM/EMM frameworks, such as MobileIron and Good, implement tunneling. If you're integrating with one of these frameworks, you may not need to do anything to be securing the network access. Or you could register your class as BBRequestSerializerDelegate and alter all of the NSURLRequests used by the framework. Check the BBRequestSerializationManager class page to know how to do that.

Handling Attachments and Links

The framework provides a way for you to intercept clicks on web links and attached files in chats and posts. With the functionality of the BBURLManager & its delegate, BBURLManagerDelegate, you'll be notified of any clicks on URLs and attachments and open them up in an external app of your choosing, or block the opening altogether. This functionality comes after the framework has evaluated the allowWebView property of BBApplicationLaunchParameters. If allowWebView is set to NO, your BBURLManagerDelegate will not be called at all.