Push notification provides an innovative solution for keeping the mobile application users informed with recent updates from application server. This technology is to accomodate mobile messaging infrastructure, which were previously conquered by SMS or MMS. Unlike SMS, Push notification is messaging feature which is developed by using Internet-based infrastructure to deliver a message through installed application in iOS, Android and Windows Phone devices. The notification received can display messages, play the selected sound and displaying the badges.
Crosslight Integrated Push Notification Services gives you a quick access to retrieve device token, deliver and receive push notification. By using this services, you just need a few lines of code to utilize push notifications in Crosslight-powered mobile application and let Crosslight do the rest.
In order to build cross-platform application using Crosslight, you need to understand the basic concepts of push notification. Crosslight retains these basic concepts to achieve the delivery process of push notification. Push notification service is primarily comprised of 4 components:
- Client / Mobile Application
This component refers to all cross-platform mobile applications that are developed by using Crosslight.
- Application server
Server-side component, which is mostly web-based server responsible for initiating the process of sending push notification and managing device token in the database.
Database stores all the registered device tokens.
- Platform Store Service
Push Notification Server consists of Apple Push Notification Service, Google Cloud Messaging Service and Microsoft Push Notification Service. All of them are centrepieces of push notification feature for each corresponding platform.
In general, the push notification process is categorized into two steps, which are requesting device token and sending push notification. The following diagram illustrates the process of requesting device token and storing it to the database:
As seen in the above diagram, retrieving device token and storing it into database require the following actions:
- Requesting Device Token
Mobile application must responsible for requesting device token to the related platform store service.
- Retrieving Device Token
Platform store service replies the request by sending an important information. If the request is valid, platform store service will send the information which consists of device token.
- Registering Device Token
The client application should be prepared to receive the device token and register it to the application server soon after the device token is retrieved.
- Storing Device Token
Application server stores this device token to the database. Later, this device token will be used by application server in order to send push notifications.
Once the device token is stored in the database, your application server is now capable of sending push notification. The diagram below visualizes the high level overview of sending push notification with connection to Platform Store Service. However, the diagram doesn't include the process of composing a message and passing it to the web/application server.
Sending push notification involves 3 major steps, which are:
- Retrieving device tokens from database
The application collects all device tokens from database. Each device token will be packaged with the message to create sendable push notification.
- Queueing notifications to designated Device Tokens
The valid and sendable push notification is going to the queue and it will be sent to the platform store service soon when its turn comes.
- Platform Service Store forwards the notifications to respective device
The platform store service receive the packaged notification and forwards it to the application based on the device token information.
At this point, you have learnt the basic concept of push notification and understand how it works. The following pages will discuss about push notification implementation with Crosslight in more details. It is suggested that you read these pages consecutively.