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 and extract the the latest version of the Spark Communications Services SDK.

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 and Key Management

By default, all examples operate with user authentication disabled. This allows you to use any unique user identifier such as a user name or email address to register users. Note that this feature works only with sandbox domains and must be explicitly enabled. Some examples may optionally be configured to use Google SignIn or Azure Active Directory for user authentication.

All examples are pre-configured to use the BlackBerry Key Management Service which provides automatic management and synchronization of keys. Additional reference implementations for key management via Google Firebase or Azure Cosmos DB are provided.

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.

Configure the Example Applications