Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Google Cloud Messaging work with Facebook?

I'm wondering, is it possible to make Facebook application send message via GCM service to my android app updates about new posts/messages/contacts etc? I'm almost sure that something like that is possible for Google+, and also I noticed that Facebooks API messages structure is very similar (or identical) to GCM messages. That is why i think it should be possible.

In other words: Is it possible to make Facebook application work as a server that stores devices IDs and sends messages on some changes via Google Cloud Messaging?

like image 690
Stigi Avatar asked Sep 14 '12 14:09

Stigi


1 Answers

You'd have to drop in some kind of middleware to handle the interaction between the Facebook and Google API's -- with that being said, it's definitely possible.

Facebook's API offers the ability to subscribe to events (realtime). There's only a handful of events that you can subscribe to, and everything is outlined here and here.

Alternatively, you could long poll for data that's not revealed via their realtime API. Just think about API limites, etc. before hand.

Keep in mind that you'll need to create a Facebook application, and your users will have to authenticate the Facebook application so that you have information to whatever info you're trying to access. Sames goes for Google.

like image 103
Nick Parsons Avatar answered Sep 22 '22 22:09

Nick Parsons