Closed elmigranto closed 9 years ago
Okay, I think I need to redo sender-cli, thought it'll be easier to incorporate, but there are some issues.
No problems, the client side isn't ready as well.
Any progress? I was hoping to finalize that quickly, our client has been waiting for GCM since the android launching...
For the custom payload, sending it as stringified JSON is fine.
For the tag, it can be set using the body.push.app
field, this will make enough sense.
Finishing up today or tomorrow.
This is ready. Please test it with real GCM and Apple APIs, though.
I have hard time getting notifications through GCM, and can not test tag
part for now. It takes like 15 minutes for notification to appear, if at all.
Okay, can this be tested independently of anything else? (How?)
There's a simple test for GCM sender much like APN one:
GCM_API_KEY=key GCM_TEST_TOKEN=token mocha tests/test-sender.coffee
This will send one notification to the device. To test sending multiple notifications, you can modify tokens inserted by populateRedis
within sender-cli.coffee
so they are of type gcm
.
Implemented sender for Android notifications. Works, but with some limitations due to GCM API.
Issues
The main issue…
…is that we can not send arbitrary payload alongside with notification, Google only allows (see specs under "Payload
data
"):So for now I send the following:
Appearance
When user clicks on notification, nothing happens for now, we need to specify stuff (
click_action
).Notifications are not grouped. So if we send 20, there will be 20 cards in phone's notification tray. That is solvable by specifying
tag
.These two (and maybe some others) should probably be responsibility of service who sent the notification in the first place. But that varies from APN, and same APN functionality is missing (unless it has default behaviour, let me know, if we need to work on these). Also, GCM allows to send iOS notifications as well, maybe that can be useful.
How to set things up
This part is pretty straight-forward:
process.env.GCM_API_KEY
.