I am stumped here. A Phonegap/Mobile Dev newbie here. Looking for some advice.
I have a phonegap app(with push plugin) developed for both Android and iOS. I was trying to test push notifications on Android. I have the following flow
- Device registers with GCM(or APNS) and sends the token back to server.
- On Server side I determine the identity of the user and create a channel for them on PubNub.
- Server registers the device with PubNub along with the channels.
- I can verify that the device has been subscribed to a few channels.
- I send a message from server side.
- I see it in the PubNub console.
- But no notification on Android.
When I try to use one of the free services(found some php code on fiddle) available to try sending messages to the device, it works. I see notifications on the device.
I tried sending messages directly from the PubNub console with no luck.
{
"pn_apns": {
"aps" : {
"alert": "Game update 49ers touchdown",
"badge": 2
},
"teams" : ["49ers", "raiders"],
"score" : [7, 0]
},
"pn_gcm": {
"data" : {
"summary": "Game update 49ers touchdown",
"teams" : ["49ers", "raiders"],
"score" : [7, 0],
"lastplay" : "5yd run up the middle"
}
},
"full_game" : {
"date" : "2014.05.20",
"background" : "Data that is not pertinent to devices"
},"pn_debug": true
}
Note 1 - I have already added the GCM API key on PubNub. Note 2 - I am using the free tier
So, I figured, maybe something wrong with PubNub and I move to Parse.
I create channels, register device and send messages all via curl(REST). I see push notifications on parse dashboard but still no messages on the device.
I haven't tested on iOS yet(working on some other iOS related issues).
I have followed the tutorials to the line for both PubNub and Parse. At this point, I am wondering if the device themselves need to subscribe to PubNub/Parse and a backend service cannot be used to subscribe them.
Please help.