BBAppDelegate

This object is your primary interface to the Symphony App. Your UIApplicationDelegate should implement all of the following selectors of the UIApplicationDelegate protocol and pass the original arguments to the BBAppDelegate sharedInstance.

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

The first call you should be making to BBAppDelegate sharedInstance is application:didFinishLaunchingWithOptions:. When you do, make sure you are passing along a BBApplicationLaunchParameters object in the launchOptions dictionary under the key BBApplicationParameters.

‚ÄčBBApplicationLaunchParameters is how you will control behaviors of the Symphony App such as whether copy/share/addressbook-access are enabled.

Properties

authDelegate
authDelegate
@property (nonatomic, weak) id <BBAuthorizationDelegate> authDelegate;

authDelegate() If you would like to override the standard Symphony sign-in experience, you should supply an object which conforms to the BBAuthorizationDelegate. Set the authDelegate property before calling application:didFinishLaunchingWithOptions: If you change or reset or nil the authDelegate after calling application:didFinishLaunchingWithOptions: your changes may not be respected.

Class Static Methods

sharedInstance
sharedInstance
+ (BBAppDelegate *)sharedInstance;

sharedInstance You should not call BBAppDelegate alloc init to get a copy of the BBAppDelegate. Instead use BBAppDelegate sharedInstance. Returns the shared instance of BBAppDelegate. Using your own copy of BBAppDelegate may seem to work, but many features of the app will not behave correctly.

Methods

application:didFinishLaunchingWithOptions
application:didFinishLaunchingWithOptions
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions;

application:didFinishLaunchingWithOptions: Call this from your UIApplicationDelegate's own application:didFinishLaunchingWithOptions:

  • application Pass the original parameter.

  • launchOptions Pass the original parameter. However, if you would like to customize the way the Symphony app acts, you must add a BBApplicationLaunchParameters object to the launchOptions dictionary under the key BBApplicationParameters.

applicationWillResignActive
applicationWillResignActive
- (void)applicationWillResignActive:(UIApplication *)application;

applicationWillResignActive: Call this from your UIApplicationDelegate's own applicationWillResignActive:

  • application Pass the original parameter.

applicationDidEnterBackground
applicationDidEnterBackground
- (void)applicationDidEnterBackground:(UIApplication *)application;

applicationDidEnterBackground: Call this from your UIApplicationDelegate's own applicationDidEnterBackground:

  • application Pass the original parameter.

applicationWillEnterForeground
applicationWillEnterForeground
- (void)applicationWillEnterForeground:(UIApplication *)application;

applicationWillEnterForeground: Call this from your UIApplicationDelegate's own applicationWillEnterForeground:

  • application Pass the original parameter.

applicationDidBecomeActive
applicationDidBecomeActive
- (void)applicationDidBecomeActive:(UIApplication *)application;

applicationDidBecomeActive: Call this from your UIApplicationDelegate's own applicationDidBecomeActive:

  • application Pass the original parameter.

applicationWillTerminate
applicationWillTerminate
- (void)applicationWillTerminate:(UIApplication *)application;

applicationWillTerminate: Call this from your UIApplicationDelegate's own applicationWillTerminate:

  • application Pass the original parameter.

application:didReceiveRemoteNotification
application:didReceiveRemoteNotification
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo;

application:didReceiveRemoteNotification: Call this from your UIApplicationDelegate's own application:didReceiveRemoteNotification:

  • application Pass the original parameter.

  • userInfo Pass the original parameter.

application:didRegisterForRemoteNotificationsWithDeviceToken
application:didRegisterForRemoteNotificationsWithDeviceToken
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;

application:didRegisterForRemoteNotificationsWithDeviceToken: Call this from your UIApplicationDelegate's own application:didRegisterForRemoteNotificationsWithDeviceToken:

  • application Pass the original parameter.

  • deviceToken Pass the original parameter.

application:didFailToRegisterForRemoteNotificationsWithError
application:didFailToRegisterForRemoteNotificationsWithError
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;

application:didFailToRegisterForRemoteNotificationsWithError: Call this from your UIApplicationDelegate's own application:didFailToRegisterForRemoteNotificationsWithError:

  • application Pass the original parameter.

  • error Pass the original parameter.

application:openURL:sourceApplication:annotation
application:openURL:sourceApplication:annotation
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;

application:openURL:sourceApplication:annotation: Call this from your UIApplicationDelegate's own application:openURL:sourceApplication:annotation:

  • application Pass the original parameter.

  • url Pass the original parameter.

  • sourceApplication Pass the original parameter.

  • annotation Pass the original parameter.

logoutAndPreserveData
logoutAndPreserveData
- (void)logoutAndPreserveData;

LogoutAndPreserveData Use this method to log the user out. Nothing special is done to local data at the time the user is logged out. This will be useful in cases where the MDM service indicates that the user has lost access to the network. No UI is shown to the user. Any messaging about why the user is being logged out should be performed by the caller. This must only be called from the main thread.

logoutAndClearData
logoutAndClearData
- (void)logoutAndClearData;

LogoutAndClearData Use this method to log the user out. Local data is removed a the time the user is logged out. This will be useful in cases where the MDM service indicates that the user has lost access to the network. No UI is shown to the user. Any messaging about why the user is being logged out should be performed by the caller. This must only be called from the main thread.

resetApplicationLaunchParameters
resetApplicationLaunchParameters
- (void)resetApplicationLaunchParameters:(BBApplicationLaunchParameters *)launchParams;

ResetApplicationLaunchParameters When the policies change, use this to change the various permissions set in the BBApplicationLaunchParameters . The POD domain cannot be changed after the call to didFinishLaunchingWithOptions: If you call resetApplicationLaunchParameters: before didFinishLaunchingWithOptions:, your BBApplicationLaunchParameters will be overwritten by the defaults when you do call didFinishLaunchingWithOptions This should only be called after didFinishLaunchingWithOptions

updateApplicationIconBadgeNumber
updateApplicationIconBadgeNumber
- (void)updateApplicationIconBadgeNumber;

UpdateApplicationIconBadgeNumber Use this method to trigger the count update of the App Icon at the home screen. This method will retrieve the correct updated count and set the app badge count.

Constants

kLoginWithUserNameSKey
kLoginWithUserNameSKey
FOUNDATION_EXPORT NSString * const kLoginWithUserNameSKey;

kLoginWithUserNameSKey If you supply a BBAuthorizationDelegate, the application will turn over control to you whenever sign-in is required. When you have obtained the correct values, you post kLoginWithUserNameSKey notification to the default NSNotificationCenter.

An example of this notification would look like this:

kLoginWithUserNameSKey Notification
kLoginWithUserNameSKey Notification
NSDictionary *params = @{ @"antiCSRFCookie" : anticsrf, @"Cookie" : skey, @"kmCookie" : kmsession, @"kmAntiCSRFCookie" : kmAnticsrf };
[[NSNotificationCenter defaultCenter] postNotificationName:kLoginWithUserNameSKey object:self userInfo:params];

The notification should contain four values. Two are cookies. One from the main Symphony server ("Cookie") and one from the Key Manager ("kmCookie"). The other two are Anti-Cross-Site-Request-Forgery Cookies. These four values are obtained from the server either in the Set-Cookie response header or from the custom X-Symphony-CSRF-Token & X-KM-CSRF-Token response headers for Symphony and the Key Manager respectively.

You might reimplement the same calls that the web client uses to obtain these values, or you might obtain these values through a custom authentication flow. Exactly how you might obtain these four values are beyond the scope of this document.

If you follow the web-based SSO flow, here is where you can expect to find the four values. There are two relevant response headers from the call to <pod>/login/sso/acs Set-Cookie: Set-Cookie:

There are two relevant response headers from the call to <pod>/relay/setsession Set-Cookie:

x-km-csrf-token:BBApplicationParameters
x-km-csrf-token:BBApplicationParameters
FOUNDATION_EXPORT NSString * const BBApplicationParameters;

BBApplicationParameters When you are ready to start the Symphony Application, such as when your appDelegate responds to application:didFinishLaunchingWithOptions:, you create a BBApplicationLaunchParameters object and pass it to BBAppDelegate sharedInstance through "application:didFinishLaunchingWithOptions:." The BBApplicationLaunchParameters is passed in the launchOptions dictionary under the BBApplicationParameters key.