Want mobile push messaging with #SAPNWCloud ? Fork away!
Mobile push messaging should be an essential part of the real-time enterprise and now it’s easy to achieve with sapnwncloud . Mobile push messaging enable you to instantly push important business event to the mobile phones of decision makers in the business. They can then take the appropriate action.
I hereby release two open-source projects that will handle most of the complexity involved in such scenarios. It’s released on github under Apache 2.0 license,and and therefore should be very compatible for most purposes. Github also makes it dead easy and encourages you to fork the project, so please do!
For now, the projects supports Android through Google Cloud Messaging. But with some assistance from the community, I’m sure we will be able to support iOS devices (Apple Push Notification Service) and other emerging mobile platforms soon.
The reference android app implementation is available here (link to android .apk)
The reference backend implementation is hosted on #sapnwcloud https://androidgcmbackendp013234trial.nwtrial.ondemand.com/nwcloud-androidgcm-backend/
Project: nwcloud-androidgcm-backend
Hosted at https://github.com/elsewhat/nwcloud-androidgcm-backend
The project provides a backend for handling the mobile push messages.
It has the following responsibilities:
- Keep track of registered devices
Handled through a REST interface called from the mobile clients - Provide a push message interface to clients
Handled through a REST interface called from an onPremise solution, a mobile client or any other program - Send the push message to the mobile client
Uses the framework provided by the mobile platform. Currently, only Google Cloud Messaging is used but easily extendable.
(requires that we create a Google API project with GCM and that we generate a server API key)
This project uses JPA for persistence and Jersey for REST interface.
Project: nwcloud-androidgcm-app
Hosted at https://github.com/elsewhat/nwcloud-androidgcm-app
This android app is a reference app that provides two main functionalities:
- Register the android device and the app so that it can receive mobile push messages.
This registration is done to Google’s GCM service and to the #sapnwcloud backend application.
This step is required before it can receive any messages - Send mobile push message to other mobile devices
This uses only the REST interface of the #sapnwcloud backend app (requires that other mobile devices are also registered in the backend)
When the app is started, it contacts Google’s GCM service and receives a registration key. This registration key is specific for the device and the Google API project we use (shared API project for app and the backend). The registration key and the email address of the user is then sent to the REST interface of the backend. We use email as an indicator of the device that should receive the mobile push message.
The app then fetches a list of all the emails that are registered in the backend, and allows you to type a message.
When you select to send the message, the app will send it to the backend using the REST interface. The backend will then subsequently send it to the recipient over the Google Cloud Messaging service (for this it uses the registration key of the recipient).
Please note that this app only illustrates one possible way to trigger a mobile push message through the backend.
This project uses google-http-client-java for performing REST (it’s transparent serialization from Java objects to JSON and back is awesome)
Other client uses
You do need an app on the device in order to register to the push service. However, once it is registered the push message could be initiated from anywhere.
The #sapnwcloud backend provides a REST interface over HTTP, so all a potential client needs to support is plain HTTP.
Here are some examples that can be implemented easily:
- A workflow has entered a critical step that must be handled immediately. The workflow will call the REST interface of the #sapnwcloud backend and pass a message and the emails of the recipients. The push message is almost instantly sent to the mobile devices who can take the appropriate actions.
- A new prioritized work order is created and should be handled before existing ones. The onPremise system can send a message to the worker which is already using a mobile app for planning his work
Enjoy, and on behalf of the SAPMentors; keep sharing!
This is great stuff! Thanks for sharing!
Thanks for sharing this - and I mean both this blog as well as your Open Source projects!!!
That's exactly that type pf stuff we want to encourage among our community and so I'm happy to see you as a shining example. Julie and Johannes developed a iOS push app called Twaddle and so we should have the means to setup a codebase that would target the most used mobile platforms.
I've already started trying to convince people internally to consider open-sourcing the Twaddle code-base...stay tuned!
Looking forward to seeing you in Madrid soon!
Cheers,
Matthias
Thanks,
The goal should be for the community to produce a set of building blocks that are more or less ready for production use. This will allow new rapid development of new solutions on #sapnwcloud
BTW do you know which APN library Twaddle used for iOS push notifications?
As far as I can see https://github.com/notnoop/java-apns looks to be a good fit and has a commercially compatible license (BSD 3-clause).
See you in Madrid
Dagfinn
Hi Dagfinn,
I have downloaded the apk from project "Project: nwcloud-androidgcm-app" into my android mobile and installed the application. But once I launch the app, I just see a dropdown with text "No devices registered", a text box and a button "Send push message" which is always disabled. Please can you help on how to get push message notification working?
Best Regards,
Abhishek.