Today all famous apps run on almost all platform to cater most of the audience. To develop and support all platforms to your app requires lots of platform specific things to address. There are some frameworks like PhoneGap which has reduced this work and provided a way through which one can write entire app using this framework and then convert this into target platform like iOS, Android and more.
However there are still lots of things which are beyond the offerings of these frameworks. Making cross platform Push Notification support is one of them. Before we go into detail of challenges, lets see what are the key component in Push Notification Engine.
Key components in Push Notification Engine is described below
- Push Server which will send the notification to target client once message is available. Each provider has its own Server like APNS for iOS, GCM server for Android, MPNS for Windows and so on. It also provides the interface to register the application for push enablement.
- App Back-end Server which will send the notification to Push Server (APNS/MPNS/GCM etc)
- Push Client which runs on device and keeps on listening to server for incoming messages. This client is background process and is common for all applications running on the device. Once message is received it will wake up the app for which message has been received.
Challenges on Supporting Cross Platform Push Client
- In order to make cross platform push, your custom push client should work on all devices. However there are some limitation in running a background process on iOS and Windows devices.
- Taking app to wake-up state is another challenge imposed on some devices.
- Spawning one push client for each app is not a wise decision because you will end up using lots of battery power.
App42 Push Notification Service uses the same technique to deliver cross platform push notification to your app with out writing any backend server. You can send a message to any target platform from any device/platform using following sample Android code snippet
1 2 3 4 5
String userName = "Nick"; String message = "Hi Nick! you have won 10 points"; ServiceAPI api = new ServiceAPI("API_KEY","SECRET_KEY"); PushnotificationService pushnotificationService = api.BuildPushnotificationService(); PushNotification pushNotification = pushnotificationService.sendPushMessageToUser(userName,message);