Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    marketplace-mod

    Send push notifications from your server through GCM

    In this age of smartphones, the android app plays a great role for your e-commerce store. In order to notify the customers about the latest featured products and categories, the notifications seem to be a required option. The notifications in the android app can send in two ways: pull and push.

     

    In pull notification, the app hits the server and gathers the data while in push notification, the server sends the data by its own. Although, the pull notification is very easy to implement but pulling consumes a lot of battery and reduces the battery life as it requires constant connection with the server.

     

    Due to some of these disadvantages, the push notification comes into light. The push notification can be easily implemented using GCM(Google Cloud Messaging). The GCM is a free service that allows developers to send data from third party servers to their applications running on android devices.

     

    In order to send the notification from the server, we need to generate a GCM authorization key (needed on the server side for sending the messages to google cloud), sender ID/ project ID (required in the app to getting the token from GCM server and register it with your server.

    For these, you have to register your application on the google server

    https://developers.google.com/cloud-messaging/android/client

     

    You can send the notification to all the apps using the token ‘global’.

    The code underneath will describe other things very well.

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close