Skip to content

Configuring Push Notifications

Defining Push Notifications

Configure push-related settings for the selected application.

Use native push to send push notifications. The push listener service provided with SAP Mobile Services allows back-end systems to send native notifications to devices. Application developers must enable push notification code in applications. You can also use the native push mechanism to push notifications to a subset of users.

Note

Text message (SMS) support is not available.

For the selected application, select Mobile Push Notification under Assigned Features (or add it first).

  • Select Configuration to configure push notifications.

  • Select Push Registrations to view current registrations and send push notifications. See Sending Push Notifications to send a message.

  • Select Service Keys to view and manage API keys. See Sending Notifications via the REST API to send push messages from back-end systems.

  • Select Info to view feature details and to download mobile service data in JSON format.

Firebase Cloud Messaging Canonical IDs

For Firebase Cloud Messaging (FCM) clients, canonical IDs prevent problems that could occur if a client application inadvertently triggers multiple registrations for the same device. For example, the device could receive duplicate messages.

If a FCM client application sends a message that contains an old registration ID, FCM processes the request and inserts the canonical ID into the registration_id field of the response.

SAP Mobile Services:

  • Replaces the old registration ID that is stored for the device with the canonical ID.

  • Uses the canonical ID for sending messages to the device.

  • Logs a customer event to inform the client of updated or deleted device registrations that result from managing canonical registration IDs.

Enabling Preconfigured Push for SAP Mobile Apps

Enable or disable preconfigured push settings.

  1. In SAP mobile service cockpit, select Mobile Applications.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. Under Predefined Global Push Configuration > Predefined for SAP Fiori Client select a predefined push certificate (or leave blank to use customer configurations such as for Android and Apple).

    Note

    Predefined push is only supported for the app store versions of SAP apps.

    • SAP Fiori Client ‒ push certificate for a native/hybrid app or SAP Mobile Cards.

    • SAP CoPilot ‒ push certificate for SAP CoPilot.

    • SAP Mobile Services Client ‒ push certificate for the client of the Mobile Development Kit.

    • SAP Asset Manager ‒ push certificate for SAP Asset Manager.

  4. Click Save.

Configuring Push for Android Apps

To enable client applications to receive Firebase Cloud Messaging (FCM) notifications, configure Android push notifications.

  1. In SAP mobile service cockpit, select Mobile Applications.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. Under Android, enter the access key for Server Key. This is the access key you obtained for your Google API project (https://firebase.google.com/docs/cloud-messaging).

  4. Enter a value for Sender ID. This is the project identifier.

Configuring Push for iOS Apps

Configure APNS push notifications for the selected iOS client application or SAP Mobile Cards.

You can use either certificate or token-based authentication for APNS. The advantage of using token-based authentication is that the credentials do not expire automatically, whereas APNS certificates usually expire after one year. You can manually control the lifecycle of the key used for token-based authentication in developer.apple.com. Obtain the credentials used for token-based authentication from your developer account on developer.apple.com.

  1. In SAP mobile service cockpit, select Mobile Applications.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. To configure APNS for a development and testing environment, select Sandbox; to configure APNS for a production environment, select Production. Choose either Certificate or Token-Based as the authentication type. (Optional) If you don't want to receive APNS push notifications, under Apple, select None.

    For Certificate:

    1. Select Browse to navigate to the APNS certificate file, select the file, and click Open.

    2. Enter a valid password.

    3. (Optional) Identify the topic bundle ID that is specific to the iOS application you're setting up to receive notifications. If not configured, the bundle ID is extracted from the certificate.

    For Token-Based:

    Token Properties

    Property Description
    Topic (Bundle ID) The bundle ID that is specific to the iOS application you're setting up to receive notifications.
    Team ID The 10-character team ID you use for developing your company's apps. Obtain this value from your developer account.
    Key ID The 10-character string that is provided by Apple when you create a key.
    Key (P8) The authentication token signing key (.p8) file that you've downloaded from Apple. Select Browse to navigate to the APNS key file, select the file, and click Open.
  4. Save your changes.

Configuring Baidu Push Notification

Baidu provides a push notification routing service for users in some countries/regions. To enable this feature, configure mobile services to connect to the service.

You must subscribe to the Baidu service and obtain Baidu account credentials that include an API key and a secret key.

Because Google services are blocked in some countries/regions, SAP uses Baidu to send push notifications to users.

  1. In SAP mobile service cockpit, select Mobile Applications.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. Under Baidu, select Enable push to Android devices or Enable push to iOS devices. You can push to both Android and iOS devices simultaneously by selecting both the options.

  4. Specify the API Key and Secret Key.

  5. Push messages are accepted, but always queued with Message was queued. and not received on the device. The server and client are using the same environment (Sandbox or Production) but the configured topic is for another environment. The APNS service rejects messages when the server certificate has been used to sent multiple invalid messages too. Please generate a new certificate and use this.

Custom Push

Custom push provides a push notification routing service to a custom push server for users in some countries/regions. To enable this feature, configure a destination URL to the custom push server. Prerequisites include:

  • The custom push server must implement a Custom Push API that is able to receive push notification messages from mobile services, and then coordinate distribution of push notifications to mobile clients.

  • In SAP mobile service cockpit, you must set up a destination URL to point to an API endpoint address, such as https://custom.push.<server>.<host>/push, as described in Creating a Destination.

See the GitHub repository for Custom Push API details.

SAP Mobile Services sends a general notification message to the push destination server. The destination server handles further forwarding of the notifications.

See the GitHub repository for example custom push micro apps and test code. The custom push examples have been tested for Huawei and Xiaomi devices.

  1. In SAP mobile service cockpit, select Mobile Applications.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. Under Custom Push, select Enable Custom Push.

  4. In Custom Push Destination, select the destination that you set up for the custom push server.

  5. Click Save.

Once custom push is configured with the destination URL, the device application can register its push ID, specific to local push vendors with mobile services, and mobile services stores the ID transparently.

Later, the back end calls mobile services to send push notifications to those devices. SAP Mobile Services finds the registered push ID based on the username, application ID, and\or other information like APNS and FCM, and then sends push IDs and push messages to the custom push provider.

In this process, mobile services tries not to modify the push messages, and passes the messages to the custom push provider for parsing and processing.

Sending Push Notifications

Manage push notifications for the selected application.

This feature uses the existing push notification mechanism, but enables you to create messages to send to recipients. You can send a native push notification. The feature requires you have the Notification User role to send push notifications (if the Send Push Notification button is not enabled, the role needs to be added to your profile). Built-in security ensures that you must wait a minute between sending notifications, to prevent spamming users. Even if you click Cancel to stop a message, you must wait the full minute before sending the next one.

  1. In SAP mobile service cockpit, select Mobile Applications > Native/Hybrid or SAP Mobile Cards.

  2. Select an application, then select Mobile Push Notification under Assigned Features (or add it first); for SAP Mobile Cards select Features > Push Notification.

  3. Select Push Registrations to see a list of registered users who are eligible for push notifications.

    You can click the Customize Table Columns icon action-settings to change the columns that appear.

    Registered Users Default Columns

    Category Description
    User Name User name of the registered user.
    Device ID The device type for the registered user, such as Android or IOS.
    Push Provider The push provider associated with the device.
    Push Group The push group associated with the device.
    Created At (UTC-700) The time the device registered in UTC format.
    Actions Indicates any actions you can take for the registered user, such as sending a notification, or deleting the registration.
  4. You can use the filters to help find a subset of registered users.

    Filter Criteria

    Filter Description
    User Name Enter a specific user name, or the start of a user name.
    User Locale Enter the language. This field is not validated, so you can enter any string value. Use the field if you know one or more values that users entered during registration, such as EN or German.
    Time Zone Enter one or more time zones, separated by commas. This field is not validated, so you can enter any string value. Use the field if you know one or more values that users entered during registration, such as UTC-1 or PST.
    Device Model Select one or more device model, such as iOS and Android.
    Push Group Enter a push group name. This field is not validated, so you can enter any string value. Use the field to create an ad hoc group for filtering. Push groups do not persist.
    Registration Timeframe Select a time frame from the list: Last 24 Hours, Last 7 Days, Last 4 Weeks, Last 3 Months, Last 6 Months, Last 12 Months, or Custom Defined (use the date-time picker to define a range).
  5. Select Send Notification to send a push notification to a registered user. In Send Push Notification, type your message and select Send. The native push notification was sent successfully. appears.

  6. Select delete to remove a registered user from the push notification list.


Last update: April 14, 2021