BlackBerry Spark Communications Services Guide

Getting Started with iOS

This overview will guide you through the steps required to integrate the BlackBerry Spark Communications Services SDK for iOS with your application.

Prerequisites

To build and run an application using the SDK, you will need:

Add the SDK Framework to your Application

The SDK contains a framework that must be imported into your project:

Download & Configure the latest version of the SDK for iOS.

Copy the contents of the sdk and sdk-release folders to your Xcode project folder.

Drag BBMEnterprise.Framework into the Frameworks folder of your project in Xcode.

On the left side of the screen, click the project.

Under TARGETS, click the target for your application.

At the top of the screen, click Build Settings.

In the search text field in the upper-right corner of the screen, type Framework Search Paths.

On the left side of the screen, drag the directory in which you placed BBMEnterprise.framework into the Framework Search Paths. iOS Search Paths

In the search text field in the upper-right corner of the screen, type Bitcode.

Next to Enable Bitcode, in the drop-down list, select No. iOS Enable BitCode

Drag the BBMEnterprise.framework into the Embedded Binaries section of the general settings for your application target.

Set your Application's Capabilities

In Xcode, under TARGETS, click the target for your application.

At the top of the screen, click Capabilities.

Ensure that the check boxes next to all the following modes are selected.

iOS Background Modes

Mode Name Description
Audio, AirPlay, and Picture in Picture This allows your application to play audio alerts when a user receives voice or video calls. Each user must grant permission for your application to use the microphone prior to using it for the first time.
Voice over IP

This allows your application to make and receive voice and video calls.

Remote Notifications

This allows your application to display incoming messages while the application is running in the background.

This following lines will add the necessary background modes to your application's Info.plist. See Apple's programming guide on Background execution for additional information.

<key>UIBackgroundModes</key>
<array>
        <string>voip</string>
        <string>audio</string>
        <string>remote-notification</string>
</array>

Start the SDK

To start the SDK service, see the example code below.

// Start the SDK service by supplying your application's domain.

[[BBMEnterpriseService service] startService:@"Your SDK Domain ID"
                                 environment:kBBMConfig_Sandbox
                             completionBlock:^(BOOL success) {
    // Update the UI once there is a response.
    // Perform any appropriate actions here such as display existing chats.

    // Once the BBM Enterprise service has successfully started,
    // you may now invoke the sendAuthToken API.
}];

Substitute the ID of the SDK domain that you created earlier for Your SDK Domain ID.

The environment parameter will determine which servers the SDK will connect to.

Authentication

Your application is responsible for providing access tokens to the SDK with the BBMAuthTokenMessage APIs. These tokens are used to identify, authenticate, and authorize your users.

As described in the Identity Providers guide, you can configure your domain in the sandbox to have user authentication disabled. Your application must still provide tokens using the BBMAuthTokenMessage APIs, but instead of getting them from a real identity provider, your application generates its own unsigned JWT tokens.

By default, all examples expect your domain to have user authentication disabled. Some examples may optionally be configured to use Google Sign-In or Azure Active Directory as an identity provider.

Key Management

By default, all examples use the BlackBerry Key Management Service which provides automatic management and synchronization of keys. The Support library comes with code that you can use for using Cloud Key Storage with Google Firebase or Azure Cosmos DB.

Support Library

Source code for several helper classes can be found in the Support library. Classes and interfaces for handling authentication, key management, and user management are provided. Where applicable, these classes are written to allow you to utilize your own back-end storage or authentication scheme. Example implementations based on Google Sign-In/Firebase and Microsoft Azure Active Directory are provided and used throughout the example applications.

If you use the support code in your application, please note the following.

Configure the Example Applications