Binding a Mobile Client with the Push Notifications service

Prerequisites

Android
  • A Google account

  • Access to the Firebase console. See Firebase Setup to get started.

iOS
  • An Apple Developer account

  • An APNs client TLS certificate. Have a look at APNs Setup for further instructions.

To use mobile services, you must represent your mobile app in OpenShift using a Mobile Client, and that Mobile Client must be associated with the mobile service. This association is called binding and it is necessary for your mobile app to use that service.

To associate a Mobile Client with a mobile service:

Procedure

  1. Navigate to the Overview of your OpenShift project.

  2. Select the Mobile Client name listed in the Mobile Clients section.

  3. Navigate to Mobile Services tab.

    mobile clients services all unbound
  4. Click Create Binding and follow the Create Binding wizard to associate the Mobile Client with the Push Notifications Service.

  5. Fill out the binding parameters required by the Push Notifications Service.

When you bind a mobile client to the Push Notifications service, a variant is created to store the credentials required to communicate with a push network. Those credentials need to be provided in the binding dialog.

First pick your Mobile Client Type. Depending on the selection you then have to fill out the fields for either Android or iOS.

Android

You need to provide a Server Key and a Sender ID. Both can be found in the Firebase console under Project Settings > Cloud Messaging. Make sure that you have selected Android in the Mobile Client Type dropdown.

iOS

You need an APNs client TLS certificate. Have a look at APNs Setup for instructions on how to obtain one. Make sure that you have selected iOS in the Mobile Client Type dropdown. The certificate needs to be encoded in base64 before copying it into the field labelled iOS .p12 file. If you’re on Mac OS run:

cat <path/to/your/.p12> | base64

If you’re on Linux chances are that you’re using a version of the base64 tool that does line wrapping. You need to disable this:

cat <path/to/your/.p12> | base64 --wrap=0

After clicking Bind your variant will be created in UPS and you should see a new binding for your mobile client.