Send Push Notifications To Your Native iOS App
- How to configure push notifications on SAP Mobile Services
- How to send a push notification from SAP Mobile Services to you native iOS application
Prerequisites
- Set Up SAP BTP SDK for iOS
- Created Your First App using SAP BTP SDK Assistant for iOS
- Apple Developer Account: A paid Apple developer account is required
- Step 1

You have built a native iOS application for a service technicians of a company that manufactures washing machines.
As a technician you are assigned an area to serve. To plan your work, you need to constantly be aware of the open issues in your region.
Therefore, you want to be notified immediately every time a new issue is created by the customer, even if you are not actively using the service technician app.
In this tutorial, you will learn how to send push notifications to your mobile application using Apple Push Notification Service (APNS). Click here to learn more about push capabilities on SAP BTP SDK iOS.
- Step 2
-
Click Mobile Applications → Native/MDK in the sidebar.
-
Click New located at the top right corner.
-
Use the following table to fill the details requested in the New Application Wizard.
Key Value ID sdk.ios.push.appName Push Notification iOS AppDescription Push Notification iOS AppVendor No Change License Type No Change Domain of Application Route No Change -
Click Next.
-
Click Next on the XSUAA Settings step of the Wizard without making any changes.
-
Select Native Application in the Assign Features for drop down menu.
-
Enable Mobile Sample OData ESPM by selecting the check box in the features table.
-
Click Finish.

-
- Step 3
-
Launch SAP BTP SDK Assistant for iOS.
-
Click Create New located near the bottom left corner.
-
Click Reuse Existing Application in the project template step.
-
Select the SAP Mobile Services account in which you created the server side configuration and click Next.
If prompted, use your SAP BTP credentials to complete the SSO login.
-
Select the app you created in the second step and click Next.
If prompted, use your SAP BTP credentials to complete the SSO login.
-
Use the following table to fill the project details requested in the Provide the Xcode project configuration step of the assistant, and click Next.
Key Value Product Name iOSPushAppOrganisation Name SAPOrganisation Identifier com.sapBundle Identifier Auto generated Path No Change Mac Catalyst Deselect -
Click Next.
-
Click Finish.
If prompted, click Trust and Open in the warning pop-up to open the newly created Xcode project.

-
- Step 4
-
Click the
iOSPushApp.xcodeprojfile to open the project configuration of your app. -
Select Signing & Capabilities Tab.
-
Enable Automatic manage signing.
-
Select the correct Signing Certificate & Team.

-
- Step 5
In order to use the Apple Push Notification service, we need to create a CSR file.
-
On your Mac, open the Keychain Access application.
-
Select Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority…
-
Click Continue on the Introduction screen of the Certificate Assistant.
-
Use the following table to fill the details requested in the Certificate Assistant.
Key Value User Email Address <Your Apple Developer Email ID>Common Name TutorialPushCertificateCA Email Address No Change Request is Save to disk Let me specify key pair information No Change -
Click Continue.
-
Select a location to save the certificate and Click Save.
-
Click Done on the Conclusion screen.

-
- Step 6
-
Log into you Apple Developer Account.
-
Click Certificates located under the Certificates, IDs & Profiles section.
-
Click
➕located next to the Certificates heading to add a new certificate. -
Select Apple Push Notification service SSL (Sandbox).
If you are building a productive app, please select Apple Push Notification service SSL (Sandbox & Production).
-
Click Continue.
-
Select the App ID (**
com.sap.iOSPushApp**) that matches the bundle identifier in your Xcode project.If you can’t find the App ID, either confirm the team and certificate configuration is accurate in the Xcode project or create a new identifier and update the bundle identifier in your Xcode project.
-
Click Continue.
-
Click Choose File and upload the
TutorialPushCertificatecertificate signing request file created in the previous step. -
Click Continue.
-
Click Download to download your
.cerThe downloaded
.cerfile is issued by the Apple Worldwide Developer Relations Certification Authority.

-
- Step 7
-
On your mac, locate the downloaded
.CERfile. -
Open the
.CERfile to install the certificate.In case the Add Certificate dialog pops up make sure to choose Login from the dropdown and click on Add.
-
Right click on the newly added certificate and click Get Info.
-
Change the trust setting to Always Trust for the While using this certificate option.
-
Right click on the certificate and click Export "Apple Sandbox Push Services: com.sap.iOSPushApp.
-
Enter a file name
TutorialPushCertificateand click Save to export the file. -
Add a password and click OK.
You must provide this password to configure the certificate on SAP Mobile Services.

What file does SAP Mobile Services need to configure the APNS Endpoint?
Select the correct one. -
- Step 8
-
Go to you SAP Mobile Services admin cockpit.
-
Click Mobile Applications → Native/MDK in the sidebar.
-
Click sdk.ios.push.app.
-
Click Mobile Push Notification under Assigned Features section.
-
Select Sandbox for the APNS Endpoint: dropdown under Apple section.
> This tutorial covers the certificate based approach.
- Click Browse and upload the
TutorialPushCertificate.p12file.
> A
.p12file is a encrypted container for the certificate and private key. This file is needed by Mobile Services for theAPNSconfiguration.-
Enter the configured password.
-
Click Save.

Which types of APNS authentication are supported by SAP Mobile Services?
-
- Step 9
-
Click
▶(Start the active scheme) in Xcode to run the application. -
Complete the onboarding steps.
> Please refer to the pre-requisite for a step by step guide for the onboarding flow.
-
Go to you SAP Mobile Services admin cockpit.
-
Click Mobile Applications → Native/MDK in the sidebar.
-
Click sdk.ios.push.app.
-
Click Mobile Push Notification under Assigned Features section.
-
Click Push Registrations (x).
-
Click Send Notification.
If the number of registrations are more than one, click send notification for the device you can access.
-
Enter a message and click Send.
-
Tap the notification on your device to open the app.
Try sending a notification when the app is in background and not running.

If you have configured your Apple Watch to display push notifications received on your iPhone, the push notification you have sent via Mobile Services will also be displayed on your Apple Watch.
-
- Step 10
-
Go to you SAP Mobile Services admin cockpit.
-
Click Mobile Applications → Native/MDK in the sidebar.
-
Click sdk.ios.push.app.
-
Click Mobile Push Notification under Assigned Features section.
-
Click Push Registrations (x).
-
Click Send Notification.
-
Select Advanced tab, and use the following
JSONpayloads.The advanced option allows app developers to define icons, sound, title, badge number etc. Please refer to the official documentation for further details.
jsonCopy{ "alert": "Notification With A Message", "badge": 0, "priority": "high", "sound": "DefaultNotificationSound" }jsonCopy{ "badge": 100, "priority": "high", "sound": "DefaultNotificationSound" }jsonCopy{ "alert": "Notification With Only A Message", "priority": "high", "sound": "DefaultNotificationSound" }
Congratulations on successfully completing the tutorial. You can now send push notifications to your native applications built using SAP BTP SDK for iOS.
-
- Real world use case
- Create server side app configuration
- Create an Xcode project using SAP BTP SDK Assistant for iOS
- Configure Signing & Capabilities
- Create a certificate signing request file
- Create an APNS certficiate in your Apple developer account
- Create a secure certificate file
- Configure push notifcations on SAP Mobile Services
- Send a simple push notification to your phone
- Send an advanced push notifications