Show TOC

Notification Data Sent Using Push APILocate this document in the navigation structure

Push messages informs users that an action should be taken by delivering a short message that appears as a notification on the device.

Configuring Authentication Provider Settings in Management Cockpit (SAP Mobile Platform)
When clicked on the notification, the application that is associated with the message is opened. A notification can be sent to a device registered with an application via a REST call to the HTTP Push API.
http://<host:port>/restnotification/application_connection_Id
The REST call should either contain a header named X-SMP-DATA or X-SMP-GCM-DATA which includes values for the title and message content to be displayed or the values can be included in the URL.
Note
  • For SAP Mobile Platform Server available on a network that uses proxy, ensure that the proxy settings are set for the SAP Mobile Platform Server under Settings > System > HTTP Proxy Settings. It allows SAP Mobile Platform Server to access GCM and APNS servers.

  • If you already have proxy settings set and SAP Mobile Platform Server is not available on a network that uses a proxy, the proxy settings should either be removed or the host for the GCM or APNS server should be added to the non-proxy hosts field.

    Both GCM and APNS require open ports that may be blocked on some corporate networks or routers.

  1. Ensure to configure the application using Management cockpit and provide the necessary details on endpoints, authentication and push settings. For more information, see Configuring the Application in Management Cockpit.

  2. The SAP Mobile Platform Server must be accessible from the backend which sends notification. The back end application must authenticate with user ID and password sent from the server. The authenticated user should have the Notification User role assigned. To add a new user and the password, edit the System Login security profile:
    1. Under Authentication Providers, add System Login (Admin Only) authentication provider.

    2. Set the values for Username, Password, for example smpPushUser and smpPushPwd and the Notification User in Roles.

    Note

    Enter the same user name and password later, when you send a notification to the device using the Advanced Rest Client or Postman Rest Client from Chrome Web Store, Google.

Configure Authentication Provider Settings in Mobile Services Cockpit (HANA Cloud Platform)
By default, HANA Cloud Platform uses SAP Cloud ID service to authenticate users against SAP user accounts. Assign Notification User role against the SAP user ID to be able to send the push notification to the device.
  1. Open the SAP HANA Cloud Platform Cockpit
  2. Select Services.
  3. Under SAP HANA Cloud Platform Mobile Services, select Roles.
  4. Select the Notification User role and assign your user ID to the role.
Note

In HANA Cloud Platform mobile Services, unauthenticated user is referred as public rather than nosec_identity as it would be in case of on-premise version of the server.

Testing Notification Service

You can use any REST tool, such as “Advanced Rest Client” or “Postman”, available from the Google Chrome Web store.

The restnotification API sends native push notifications to the applications. This RESTful service provides more flexibility for sending push messages than existing interfaces that are based on HTTP headers or URL parameters. Earlier push interfaces required that you send messages to a registration ID. The restnotification interface also sends the message to a specific user or to all users of a specific application.

The restnotification API sends messages to multiple recipients. The messages are queued in the server and sent out asynchronously.

Use HTTP POST method in the notification URL:
  • On-Premise
    http[s]://<host:port>/restnotification/<resource>
  • Cloud
    https://<HMC base URL>/restnotification/<resource>