BlackBerry Spark Communications Services Guide

Push Notifications

The BlackBerry Infrastructure supports push notifications to mobile clients. When new chat messages and incoming calls are pending delivery to the clients, the BlackBerry Infrastructure can send a push notification with one of the following mechanisms.

Direct Push

The BlackBerry Infrastructure initiates a push request directly to Apple's Push or Google's GCM/FCM servers.

Direct Push

Android

On Android, you must configure your application to receive direct pushes as described in Google's documentation on how to set up a Firebase Cloud Messaging client application on Android.

You must provide BlackBerry with your application's FCM (or GCM) server keys to allow the BlackBerry Infrastructure to initiate push requests for your application. You obtain this key when you set up your application for FCM. You provide these keys to BlackBerry using the BlackBerry Online Account page for your application, under the Communications Services tab's Push Notifications section.

Configure Direct Push for Android

Your application must request a push "token" from FCM at runtime and provide it to the SDK with the BBMEnterprise.setPushToken() method. This token is what uniquely identifies your endpoint to the push infrastructure. For example:

FirebaseInstanceId.getInstance().getInstanceId()
    .addOnCompleteListener(new OnCompleteListener() {
        @Override
        public void onComplete(@NonNull Task task) {
            if (!task.isSuccessful()) {
                Log.w(TAG, "getInstanceId failed", task.getException());
                return;
            }

            // Get new Instance ID token
            String token = task.getResult().getToken();
            BBMEnterprise.getInstance().setPushToken(token);
        }
      });    

There are no special application signing requirements for Android direct push.

iOS

For iOS, you must provide BlackBerry with your Production VoIP Services certificates from Apple to allow the BlackBerry Infrastructure to initiate Apple push requests for your application. You provide these keys to BlackBerry using the BlackBerry Online Account page for your application, under the Communications Services tab's Push Notifications section.

Configure Direct Push on iOS

When you are testing your iOS application in the sandbox, you can test direct Apple push notifications if your application is signed with a development certificate.

When you release your iOS application for production or you distribute the application with TestFlight, you must configure the SDK to use a production domain and sign your application with a distribution certificate from Apple to enable direct push notifications.

Examples

The SDK RichChat example application supports direct push on Android and iOS.

Proxied Push

Your infrastructure can initiate push requests to Apple or Google servers.

If your infrastructure will be initiating the push requests to Apple's Push or Google's GCM/FCM servers, then you will have to implement a simple REST API for the BlackBerry Infrastructure to invoke when push delivery to one of your users is required, using the user identity token supplied by your Userinfo Endpoint. In this mechanism, you do not need to share your push credentials with BlackBerry.

Proxied Push