You may clone an existing metadata project from GitHub repository and start directly with step 4 in this tutorial.

Step 1: Define push notification settings in app configuration
-
Open the SAP Mobile Services cockpit, click Mobile Push Notification feature.
You can add Mobile Push Notification feature by clicking on + icon in case feature is not already assigned to the application.
-
Select SAP Mobile Services Client under Predefined for option, click Save.
Predefined push is supported only for the MDK (SAP Mobile Services client) public store client.
If you want to enable push notification in your custom MDK client then follow this tutorial.
Step 2: Create a new MDK project in SAP Business Application Studio
-
Launch the Dev space in SAP Business Application Studio.
-
Click Start from template on Welcome page.
If you do not see Welcome page, you can access it via Help menu.
-
Select MDK Project and click Start.
-
In Basic Information step, select or provide the below information and click Next:
Field |
Value |
MDK template type |
Select Empty from the dropdown |
Your project name |
MDK_Push |
Your application name |
<default name is same as project name, you can provide any name of your choice> |
More details on MDK template is available in help documentation.
If you see Cloud foundry token expired, continue without mobile services connection? message, then set the Cloud Foundry environment again by clicking at bottom left corner of your status bar to initiate a valid session and click Start Over.
-
After clicking Next, the wizard will generate your MDK Application based on your selections. You should now see the MDK_Push
project in the project explorer. As you have already opened the workspace, there is no need to open the generated project in a new workspace. Ignore the pop-up or click the cross icon to hide the window.
Step 3: Create MDK actions to register for push notifications
In this step, you will create the following actions:
-
Push Notification Register action: this will register the device with SAP Mobile Services for push notification.
-
Message actions: these will display a message if Push Notification Register action has succeeded or failed.
-
Create a Push Notification Register action.
Right-click the Actions folder | MDK: New Action | choose MDK Other Actions in Category | click Push Notification Register Action | Next.
Provide the below information:
Property |
Value |
Action Name |
PushRegister |
More details on Push Notification Action is available in help documentation.
Click Next and then Finish on the confirmation step.
-
Define a success message if the Push Register Notification action is succeeded.
Right-click the Actions folder | MDK: New Action | choose MDK Message Actions in Category | click Message Action | Next.
Provide the below information:
Property |
Value |
Action Name |
PushRegisterSuccessMessage |
Type |
Select Message from the dropdown |
Message |
Push Notification registered |
Title |
Success |
OKCaption |
OK |
OnOK |
--None-- |
CancelCaption |
leave it blank |
OnCancel |
--None-- |
Click Next and then Finish on the confirmation step.
-
Define a failure message if the Push Register Notification action is failed.
Right-click the Actions folder | MDK: New Action | choose MDK Message Actions in Category | click Message Action | Next.
Provide the below information:
Property |
Value |
Action Name |
PushRegisterFailureMessage |
Type |
Select Message from the dropdown |
Message |
Push Notification didn't register |
Title |
Failure |
OKCaption |
OK |
OnOK |
--None-- |
CancelCaption |
leave it blank |
OnCancel |
--None-- |
Click Next and then Finish on the confirmation step.
-
Define Success and Failure actions for PushRegister.action
.
In the action editor for the new action, expand the Common Action Properties and provide the below information:
Property |
Value |
Success Action |
Click the link icon to bind it to PushRegisterSuccessMessage.action |
Failure Action |
Click the link icon to bind it to PushRegisterFailureMessage.action |
When PushRegister.action
gets executed successfully then PushRegisterSuccessMessage.action
will be triggered or if PushRegister.action
fails then PushRegisterFailureMessage.action
will be triggered.
Step 4: Call the push register action
In the step, you will set and call the Push Register Notification action when app is updated with the new metadata.
It is up to developers how they want to call a Push Register Notification action.
In Application.app
file, bind the OnDidUpdate
event to PushRegister.action
.
Step 5: Deploy the application
So far, you have learned how to build an MDK application in the SAP Business Application Studio editor. Now, you will deploy this application definition to Mobile Services.
-
Right-click Application.app
and select MDK: Deploy.
-
Select deploy target as Mobile Services.
-
Select the application from Mobile Services.
You should see Deploy succeeded message.
Step 6: Populate the QR code for app onboarding
SAP Business Application Studio has a feature to generate QR code for app onboarding.
Double-click the Application.app
to open it in MDK Application Editor and click Application QR Code icon to populate the QR code.

Step 7: Run the app in MDK client
Make sure you are choosing the right device platform tab above. Once you have scanned and onboarded using the onboarding URL, it will be remembered. When you Log out and onboard again, you will be asked either to continue to use current application or to scan new QR code.
-
Follow these steps to on-board the MDK client.
-
Once you accept the App update, a message should show Push Notification Registered. Click OK.
-
It is time now to send the first push notification from the SAP Mobile Services push notification feature.
Navigate to Mobile Services cockpit. In Mobile Push Notification feature, switch to Push Registrations tab.
There you will find information about user registered for push notification and also details about Push providers. Identify your Device ID and click Send Notification.
-
In notification dialog, type a notification message and click Send.
You will see a success toast message.
After sending notification, mobile device should receive the message.
-
Follow these steps to on-board the MDK client.
-
Once you accept app update, you will notice that it will first ask permission to display notifications.
-
If push registration is successful, a message should show Push Notification Registered. Click OK.
-
It is time now to send the first push notification from the SAP Mobile Services push notification feature.
Navigate to Mobile Services cockpit. In Mobile Push Notification feature, switch to Push Registrations tab.
There you will find information about user registered for push notification and also details about Push providers. Identify your Device ID and click Send Notification.
-
In notification dialog, type a notification message and click Send.
You will see a success toast message.
After sending notification, mobile device should receive the message.
If you have Apple watch connected to the iPhone device, you can also see same push notification on the Apple Watch.
MDK supports rich push notification. MDK does not run on smart watches or as an Apple watch application.
Once you have scanned and onboarded using the onboarding URL, it will be remembered. When you Log out and onboard again, you will be asked either to continue to use current application or to scan new QR code.
Congratulations, you have successfully implemented Enable Push Notifications in the MDK Public Store Client and you are now all set to Consume a REST API in an MDK App.