Reputation: 3466
I'm totally new to hybrid world so I have to ask first.
Can I send notifications through GCM without a server?
I mean, I'm building a SPA with AngularJS and Firebase, but my customer asked me to make a dashboard for Android, so every time an user makes an order, they (both dashboard administrators) receive a PUSH notification on their phone: "A new order has been created", and when they "tap", the application opens.
I've been reading something about /topic/
endpoint to notify both of them, but I think I still need a server to do it. Do I?
It would be great if I simply post
a http query using something like AngularJS' $http
service to tell GCM to send a notification for that topic
/usergroup
.
Is that possible? If so, any idea about how? Thank you very much in advance!
Upvotes: 0
Views: 2183
Reputation: 9225
Sending a downstream GCM message can be done "without a server". One option is to send an HTTP request to GCM containing the required fields. Topic Messaging is available with GCM which does make it easier to send downstream messages without a server. Your client apps can subscribe for messages from /topic/usergroup and then you can send an HTTP request with /topic/usergroup as your "to" value, and subscribed clients will get it.
Note that you will need to set up a Google Developer Console project to get the required API key.
Check here for more information on the structure of GCM HTTP downstream messages.
Upvotes: 3