Enable Push Notifications in the MDK Public Store Client
Use the SAP Mobile Services to enable push notifications in the MDK public store client.
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.

MDK 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.

MDK 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.

MDK Click the Application tile and choose Next.

MDK Select the Mobile category and choose Next.

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

MDK Enter the project name
mdk_push(used for this tutorial) , add a description (optional), and click Review.
MDK 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.

MDK 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.

MDK The project opens in SAP Business Application Studio.

MDK 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.

MDK
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.

MDK 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.
MDK 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.
MDK 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.

MDK Click the + button in the UI application column header to add mobile UI for your project.

MDK 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.

MDK After clicking Finish, the storyboard is updated displaying the UI component. The MDK project is generated in the project explorer based on your selections.

MDK
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.

MDK In the Base Information step, provide the below information and click Finish to complete the action creation process.
Property Value NamePushRegister
MDK 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.

MDK 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--
MDK 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.

MDK 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--
MDK 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.
MDK
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 .
MDK Select deploy target as Mobile Services.

MDK Select Mobile Services Landscape.

MDK If you want to enable source for debugging the deployed bundle, then choose Yes.

MDK You should see Deploy to Mobile Services successfully! message.

MDK
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.

MDK 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.

MDK In notification dialog, type a notification message and click Send.

MDK You will see a success toast message.

MDK After sending notification, mobile device should receive the message. This example uses the simplest notification that only contains the alert property.

MDK
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.

MDK 
MDK 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.

MDK In notification dialog, type a notification message and click Send.

MDK You will see a success toast message.

MDK After sending notification, mobile device should receive the message. This example uses the simplest notification that only contains the alert property.

MDK If you have Apple watch connected to the iPhone device, you can also see same push notification on the Apple Watch.

MDK 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" } }
MDK After sending notification, you will see a notification in the notification center.

MDK
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" } }
MDK After sending notification, you will see a notification in the notification center.

MDK
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.

