Overview
You will learn
- How to use MDK push register action
- How to use predefined push configuration for the public store version of SAP Mobile Services client (MDK client)
- How to send push notification to an MDK app
Prerequisites
Prerequisites
- Tutorial group: Set Up for the Mobile Development Kit
- Install SAP Mobile Services Client on your Android device or iOS
![]() Android | ![]() iOS |
(If you are connecting to AliCloud accounts, you will need to brand your custom MDK client by allowing custom domains.)
Steps
Intro
You may clone an existing metadata project from GitHub repository and start directly with step 5 in this tutorial.

Open the SAP Mobile Services admin UI, click Push Notification feature.

Push Notification Feature In Mobile Services Admin UI You can add 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.

SAP Mobile Services Client Predefined Option Saved 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 Enable Push Notifications in Your Branded MDK Client tutorial.
This step includes creating a mobile project in SAP Build Lobby.
In the SAP Build Lobby, click Create > Create to start the creation process.

SAP Build Lobby Create Button Click the Application tile and choose Next.

Application Tile Selection Select the Mobile category and choose Next.

Mobile Category Selection Select the Mobile Application to develop your mobile project in SAP Business Application Studio and choose Next.

Mobile Application Option Selected Enter the project name
mdk_push(used for this tutorial) , add a description (optional), and click Review.
Project Name And Description Entry SAP Build recommends the dev space it deems most suitable, and it will automatically create a new one for you if you don’t already have one. If you have other dev spaces of the Mobile Application type, you can select between them. If you want to create a different dev space, go to the Dev Space Manager. See Working in the Dev Space Manager.
Review the inputs under the Summary tab. If everything looks correct, click Create to proceed with creating your project.

Project Summary Review Screen Your project is being created in the Project table of the lobby. The creation of the project may take a few moments. After the project has been created successfully, click the project to open it.

Project Created In Build Lobby Table The project opens in SAP Business Application Studio.

Project Opened In SAP Business Application Studio When you open the SAP Business Application Studio for the first time, a consent window may appear asking for permission to track your usage. Please review and provide your consent accordingly before proceeding.

SAP BAS Usage Consent Window
The Storyboard provides a graphical view of the application’s runtime resources, external resources, UI of the application, and the connections between them. This allows for a quick understanding of the application’s structure and components.
- Runtime Resources: In the Runtime Resources section, you can see the mobile services application and mobile destination used in the project, with a dotted-line connected to the External Resources.
- External Resources: In the External Resources section, you can see the external services used in the project, with a dotted-line connection to the Runtime Resource or the UI app.
- UI Application: In the UI Applications section, you can see the mobile applications.
Click on + button in the Runtime Resources column to add a mobile services app to your project.

Runtime Resources Add Button In Storyboard This screen will only show up when your CF login session has expired. Use either
CredentialsORSSO Passcodeoption for authentication. After successful signed in to Cloud Foundry, select your Cloud Foundry Organization and Space where you have set up the initial configuration for your MDK app and click Apply.
CF Login Credentials Dialog Choose
myapp.mdk.demofrom the applications list in the Mobile Application Services editor and click Add App to Project. You do not require to add a destination for this tutorial.
Mobile Application Services App Selection You can access the mobile services admin UI by clicking on the Mobile Services option on the right hand side.
In the storyboard window, the app will be added under the Runtime Resources column.

App Added Under Runtime Resources In Storyboard Click the + button in the UI application column header to add mobile UI for your project.

Add Mobile UI Button In Storyboard In the Basic Information step, select No for the Enable Auto-Deployment to Mobile Services After Project Creation property, and click Finish. You will modify the generated project in next step and will deploy it later.

Basic Information Step Auto-Deployment Disabled After clicking Finish, the storyboard is updated displaying the UI component. The MDK project is generated in the project explorer based on your selections.

Storyboard Updated With UI Component
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 Other in Category | click Push Notification Register | Next.

Push Notification Register Action Creation In the Base Information step, provide the below information and click Finish to complete the action creation process.
Property Value NamePushRegister
PushRegister Action Base Information Step More details on Push Notification Action is available in help documentation.
Define a success message if the Push Register Notification action is succeeded.
Right-click the Actions folder | MDK: New Action | choose Message in Category | click Message | Next.

New Message Action Creation In the Base Information step, provide the below information and Click Finish.
Property Value NamePushRegisterSuccessMessageTypeSelect Messagefrom the dropdownMessagePush Notification registeredTitleSuccessOKCaptionOKOnOK--None--CancelCaptionleave it blank OnCancel--None--
PushRegisterSuccessMessage Action Base Information Define a failure message if the Push Register Notification action is failed.
Right-click the Actions folder | MDK: New Action | choose Message in Category | click Message | Next.

New Message Action Creation In the Base Information step, provide the below information and Click Finish.
Property Value NamePushRegisterFailureMessageTypeSelect Messagefrom the dropdownMessagePush Notification didn't registerTitleFailureOKCaptionOKOnOK--None--CancelCaptionleave it blank OnCancel--None--
PushRegisterFailureMessage Action Base Information 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 ActionClick the link icon to bind it to PushRegisterSuccessMessage.actionFailure ActionClick the link icon to bind it to PushRegisterFailureMessage.actionWhen
PushRegister.actiongets executed successfully thenPushRegisterSuccessMessage.actionwill be triggered or ifPushRegister.actionfails thenPushRegisterFailureMessage.actionwill be triggered.
PushRegister Common Action Properties Bindings
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.

So far, you have learned how to build an MDK application in the SAP Business Application Studio editor. Now, you will Deploy the Project definitions to Mobile Services to use in the Mobile client.
Click the Deploy option in the
Application.appheader area, and then choose the deployment target as Mobile Services .
Deploy Option In Application App Header Select deploy target as Mobile Services.

Mobile Services Deployment Target Selected Select Mobile Services Landscape.

Mobile Services Landscape Selection If you want to enable source for debugging the deployed bundle, then choose Yes.

Enable Source For Debugging Choice You should see Deploy to Mobile Services successfully! message.

Deploy To Mobile Services Success Message
SAP Business Application Studio has a feature to display the QR code for onboarding in the Mobile client. To view the onboarding QR code, click the Application QR Code icon in the editor’s header area.

The On-boarding QR code is now displayed.

Leave the Onboarding dialog box open for the next step.
Make sure you are choosing the right device platform tab above. Once you have scanned and on-boarded using the onboarding URL, it will be remembered. When you Log out and on-board again, you will be asked either to continue to use current application or to scan new QR code.
Follow these steps to successfully on-board the MDK client on your Android device.
After accepting the app update, a message should show Push Notification registered. Click OK.

Push Notification Registered Success Message It is time now to send the first push notification from the SAP Mobile Services push notification feature.
Navigate to Mobile Services admin UI. In 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.

Push Registrations Tab Send Notification In notification dialog, type a notification message and click Send.

Notification Dialog Message And Send Button You will see a success toast message.

Push Notification Sent Success Toast After sending notification, mobile device should receive the message. This example uses the simplest notification that only contains the alert property.

Push Notification Received On Android Device
Follow these steps to successfully on-board the MDK client on your iOS device.
After accepting the app update, allow the permission to display notifications. If push registration is successful, a message should show Push Notification registered. Click OK.

Push Notification Permission Request iOS 
Push Notification Registered Success iOS It is time now to send the first push notification from the SAP Mobile Services push notification feature.
In Mobile Services admin UI, navigate to Mobile Applications → Native/MDK →
myapp.mdk.demo. Under the Settings > Add-on Features, click the Push Notification feature, and 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.

Push Registrations Tab Send Notification In notification dialog, type a notification message and click Send.

Notification Dialog Message And Send Button You will see a success toast message.

Push Notification Sent Success Toast After sending notification, mobile device should receive the message. This example uses the simplest notification that only contains the alert property.

Push Notification Received On iOS Device If you have Apple watch connected to the iPhone device, you can also see same push notification on the Apple Watch.

Push Notification On Apple Watch MDK supports rich push notification. MDK does not run on smart watches or as an Apple watch application.
Make sure you are choosing the right device platform tab above.
Based on the device Operating System, notifications are handled differently. On Android, the notification is a data message and only handled by the apps notification callback. The callback is only called when the app is active. So, how can you make it visible always? You use the advanced Message properties:
gcm.title/gcm.bodyfor your message. For more information on Google/Firebase Cloud Messaging, see documentation.Send the Android client in the background or swipe close.
Switch to the Advanced tab, provide below payload and click Send.
JSON{ "alert": "Alert message", "gcm": { "title": "MDK Push", "body": "This is an advanced notification message" } }
Advanced Notification Payload Sent Android After sending notification, you will see a notification in the notification center.

Notification In Android Notification Center
Based on the device Operating System, notifications are handled differently. On
iOSoriPadOSthe notification is handled by the app when in foreground, but handled (and displayed) by the Notification Console and shown in the Lock Screen, when the app is in background. So, how can you make it visible always? You use the advanced Message properties:apns.title/apns.bodyfor your message. For more information on Apple Remote Notification, see documentation.Send the iOS client in the background or swipe close.
Switch to the Advanced tab, provide below payload and click Send.
JSON{ "alert": "Alert message", "apns": { "title": "MDK Push", "body": "This is an advanced notification message" } }
Advanced Notification Payload Sent iOS After sending notification, you will see a notification in the notification center.

Notification In iOS Notification Center
Once you have scanned and on-boarded using the onboarding URL, it will be remembered. When you Log out and on-board again, you will be asked either to continue to use current application or to scan new QR code.
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.

