I am using pubnub for push message from server for android. I get the message when app is in foreground. But i didn't get message if app is inactive in background mode or in locked mode. How can I get the pubnub message if the app is in background or not in the recent app tray ? Please help me out. Thanks.
var pubnub = new PubNub({
subscribeKey : 'sub-key',
publishKey : 'pub-key'
});
pubnub.addListener({
status : function(st) {
if (st.category === "PNConnectedCategory") {
}
},
message : function(m) {
var pushStatus = m.message;
console.log("Show Notification");
},
presence : function(ps) {
console.log(ps);
}
});
pubnub.subscribe({
channels : ['Channel']
});