How to use Push Notifications with iOS and Android Hybrid applications – part 1
I’ve decided to write this blog to show clearly how you can enable your mobile devices, iOS or Android, to leverage the capabilities of Push Notifications provided by the HCPms.
There are of course several other blogs around, talking about this, but here I would like to start from the very scratch. In the past I’ve had a lot of difficulties trying to understand how to configure push notifications APIs, specially for iOS devices. Here I’m going to show how I managed to do it, so that anyone who wants to get to grips with this stuff.
The entire blog will go through the following steps:
- Enable push notifications for Android
- Enable push notifications for iOS
- Create an application on HCPms
- Create an application in SAP Web IDE
- Deploy the app to mobile devices
- Send push notifications and test the apps
This blog has been split in 3 parts:
|This part||Step 1 – Enable push notifications for Android|
|How to use Push Notifications with iOS and Android Hybrid applications – part 2||Step 2 – Enable push notifications for iOS|
|How to use Push Notifications with iOS and Android Hybrid applications – part 3||Steps 3 -> 6 – Create an app on HCPms, then another in SAP Web IDE, deploy the app to mobile services and test the app with some push notifications|
- An account on SAP HANA Cloud Platform Trial Landscape
- Hybrid Application Toolkit up and running
- A mobile device (iOS or Android) to test our sample application
- A MACOSX machine if you are going to test push notifications on iOS device
Let’s get started!
Step 1 – Enable push notifications for Android
Follow these steps to request an API Key and get the Sender ID from the Google Developer portal. These two string will be used in HCPms in order to identify the application to send push notifications.
1 – Open your Internet browser and go to Add Google Services &nbsp;|&nbsp; Google Developers
2 – Enter an App name and the Android package name. This last one is very important because it will be used to identify our app in HCPms. Once done click on Choose and configure services
3 – Click on Cloud Messaging
4 – Click on Enable Google Cloud Messaging
5 – Write down somewhere the Server Api Key and the Sender ID because they will be used in HCPms configuration
Let’s continue with the second part of this article. If you are NOT a MAC user or you are NOT interested using Push Notifications on iOS, you can skip the second part and go directly to the last part of this blog.