Search code examples
javascriptcordovaquickblox

How to implement push notification support in Cordova app using Quickblox?


Apologies for such a basic question, but I really can't find any information on the subject.

The Quickblox Javascript SDK has some classes related to push notifications, and I have enabled them using chat_history and the alerting tab in chat. However what I don't understand is how to receive these notifications on the front end UI?

I don't have any code to share as I don't know where to start!

Any help would be truly appreciated, thank you.


Solution

  • There are modules to work with pushes:

    QB.messages.tokens
    QB.messages.subscriptions
    QB.messages.events
    

    To subscribe for pushes you have to do 2 things:

    1. Create a push token using QB.messages.tokens
    2. Create a subscription using QB.messages.subscriptions

    Additional info can be found in REST API page http://quickblox.com/developers/Messages#Typical_use_.D1.81ases

    Also you have to upload APNS and Google API key to QuickBlox admin panel.

    This all needs if you are going to build Cordova app for iOS/Android