Skip to Content

Enable Push Notifications in the MDK Public Store Client

Use the SAP Mobile Services to enable push notifications in the MDK public store client.
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
jitendrakansalJitendra KansalOctober 26, 2025
Created by
jitendrakansal
October 4, 2022
Contributors
maximilianone
jitendrakansal

Prerequisites

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

MDK
  • Step 1
    1. 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.

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

    Which option is not available under Predefined for dropdown?

  • Step 2

    This step includes creating a mobile project in SAP Build Lobby.

    1. In the SAP Build Lobby, click Create > Create to start the creation process.

      MDK
    2. Click the Application tile and choose Next.

      MDK
    3. Select the Mobile category and choose Next.

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

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

    6. Review the inputs under the Summary tab. If everything looks correct, click Create to proceed with creating your project.

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

  • Step 3

    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.
    1. 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 Credentials OR SSO Passcode option 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
    2. Choose myapp.mdk.demo from 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
    3. Click the + button in the UI application column header to add mobile UI for your project.

      MDK
    4. 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
    5. 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
  • Step 4

    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.

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

    2. 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
      NamePushRegisterSuccessMessage
      Type Select Message from the dropdown
      Message Push Notification registered
      Title Success
      OKCaption OK
      OnOK --None--
      CancelCaption leave it blank
      OnCancel --None--
      MDK
    3. 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
      NamePushRegisterFailureMessage
      Type Select Message from the dropdown
      Message Push Notification didn't register
      Title Failure
      OKCaption OK
      OnOK --None--
      CancelCaption leave it blank
      OnCancel --None--
      MDK
    4. 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.

      MDK
  • Step 5

    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.

    MDK
  • Step 6

    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.

    1. Click the Deploy option in the Application.app header area, and then choose the deployment target as Mobile Services .

      MDK
    2. Select deploy target as Mobile Services.

      MDK
    3. Select Mobile Services Landscape.

      MDK
    4. 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
  • Step 7

    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.

    MDK

    The On-boarding QR code is now displayed.

    MDK

    Leave the Onboarding dialog box open for the next step.

    What Message would be displayed in case Push register action fails?

  • Step 8

    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.

  • Step 9

    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.


Back to top