BlackBerry Spark Communications Services Guide

Configuring iOS Examples to use Google Sign-In and Google People

Some example applications for iOS can be configured to integrate with Google Sign-In as your identity provider and Google People for user management. Google integration is supported for RichChat, SimpleChat and QuickStart.

This page guides you through the changes you can make to the example applications to integrate with Google Sign-In and Firebase using the Support library.

Google Configuration

Before running the example applications with Google Sign-In and Google People, you must first configure those services for the example you wish to run.

  1. First, configure Google Sign-In as your Identity Provider.
  2. Next, configure Google People for User Management.

Application Configuration

Selecting Google Sign-In as the Identity Provider

Identity providers are listed in the ConfigSettings.plist file. To use a specific identity provider, set the authProvider key in ConfigSettings.plist to the string that matches the key for the identity provider settings you wish to use.

Value of authProvider Description
testAuth Use no user authentication.
googleSignIn Use Google Sign-In as the identity provider.
azureAD Use Azure Active Directory as the identity provider.
custom Use optional custom identity, key, and/or user managers. You may specify any custom configuration parameters required and implement the necessary code to handle them in BBMConfigManager.

An example ConfigSettings.plist excerpt is shown below.

<key>authProvider</key>
<string>googleSignIn</string>

Configure Google Sign-In and Firebase Database

Generate a Google Sign-In configuration file and a server client ID for this example as described in the Google Sign-In documentation.

Go to Firebase setup and follow steps under the heading Add Firebase to your iOS Project. Make sure you select the option Import Google Project to import the project from the previous step.

Place your configuration file in this file:

3rdParty/Google/GoogleService-Info.plist

Enter your Google client ID in the ConfigSettings.plist file by setting the value for clientId under the googleSignIn section.

An example ConfigSettings.plist excerpt is shown below.

<key>googleSignIn</key>
<dict>
    <key>userProvider</key>
    <string>googlePeople</string>
    <key>keyProvider</key>
    <string>firebase</string>
    <key>domain</key>
    <string>YOUR_DOMAIN_ID</string>
    <key>clientId</key>
    <string>701362161023-rrk31nvfkein534jglkfsv.apps.googleusercontent.com</string>
    <key>environment</key>
    <string>sandbox</string>
</dict>

Replace YOUR_DOMAIN_ID with the your application's domain ID.

Install pods

To build and run the application, CocoaPods must be installed as described in CocoaPods.

After installing CocoaPods, run the following command from the root folder of your project.

$ pod update
$ pod install

Key Management

BlackBerry Key Management Service

To use the BlackBerry Key Management Service, set the useBlackBerryKMS property in ConfigSettings.plist to true. This must be a top-level entry in the plist file. Custom key management related settings will be ignored if this is set.

An example ConfigSettings.plist excerpt is shown below.

<key>useBlackBerryKMS</key>
<true/>

Cloud Key Storage

If your application needs complete control of its cryptographic security keys, you can secure these keys by using Firebase for Cloud Key Storage.

To use Cloud Key Storage with Firebase, use the BBMFirebaseKeyStorageProvider class.

The Support library code for Cloud Key Storage in Firebase for Android, iOS, and JavaScript are fully compatible.