Subscribe a Device Group (notification_key) to a Topic - google-cloud-messaging

I've recently encountered this post where the general idea is how to subscribe a user to a topic, with multiple devices. I provided an answer, suggesting to make use of the Device Group, then doing the batchAdd on the server side.
But I was wondering if it was possible to subscribe to a topic using the device group notification_key?
I haven't seen anything that mentions something like that in the docs.
The notification key is described in the doc as:
All devices in a group share a common notification key, which is the token that FCM uses to fan out messages to all devices in the group.
So I thought maybe it was possible to use it. But can't find anything that mentions it though. I've looked around the community for any other similar posts, went through the docs, but most of it are just about subscribing a single device to a topic.
Was my answer to the post a good method? Or did I just miss something where there is already a process/flow on how to actually do this?
I haven't really tried it out myself, but it was the only way I could think of. I'm still studying about GCM & FCM and I would appreciate it a lot if someone that tried it before can shed some light about this.

You cannot subscribe a device_group to a topic. The way to achieve this would be to subscribe the tokens associated with the device group to the topic either individually or in batch.

Related

Assigning webhooks to Firebase Messaging "subscribe to topic" event

In my current project I am using the Kreait Firebase PHP SDK to send out push notifications to Android & iOS devices that have subscribed to notifications on named topics. No issues thus far. However, rather than have fixed topic names I would now like to generate topic names based on the current "condition" of the connecting device. The condition could, for example, be a geographic location.
This is not too difficult either and I have modified my app to handle this. However, in order to put the ability to have such autogenerated topics to use I need to know the topic names on my server so I can send out targeted messages via Kreait. I find Google's Firebase documentation a bit dense at times and have not been able to establish whether it is possible to assign webhooks that get called by Firebase whenever a SubscribeToTopic, UnsubscribeFromTopic event occurs.
A simple question - does FCM even offer anything like this capability? If so, any pointers to the relevant documentation would be much appreciated.
There is no public API to get a list of topic names from Firebase, nor is there a way to hook into the subscription mechanism.
Your best bet is to simply make two calls when a user subscribes to a topic: one to Firebase, and one to your own backend API that keeps a list of active topics/conditions.

Instagram - Get Direct Message

I'm writting a new post, because all of topics that was related with getting Instagram Direct message via API are a little bit old.
Do anyone knows if there is a possibility of GET Direct Messages via API or in some programatically way?
Right now, it doesn't look like you can. The Instagram Graph API docs don't mention direct messages at all. The old Instagram API never had this.
Take a look to the Component InstagramApiSharp, it contains this functionnality. There are some actions that you can built for the direct message with it.

Implementing Facebook's Like feature using Google Cloud Messaging

I have a use case to implement a 'like' feature for messages using GCM. One approach that comes to mind is to make each post a 'topic' and then send all likes on a post as a separate GCM message on that topic.
However, in order to achieve this, the client has to register for each topic corresponding to the post that it has loaded on the UI in real time. This brings me to the following questions:
This is approach right?
How long will it take for a client's subscription to a topic to reflect at GCM's end? Same for unsubscription?
Can I get a list of all subscribers to a given topic?

Can a Google Cloud Messaging message be sent from browser/Javascript?

Question says it all. All the examples I can find are for server<-->android.
I'm looking for Javascript-->android
Paid version, try PubNub (Push to Android Example) or Pusher API tools.
For open source solution, you might try PushSharp
Note the real trick is obtaining the RegID from your device. See the answers in this posting to understand better what is going on...

New Messaging System API for non developer accounts

According to this blog post the new messaging system should be accessible via the API (fql/graph) for non developer account as of end of November. It still gives OAuthException with message "You must be a developer of the application".
I was unable to find any updates on this issue from Facebook or other sources. Anyone knows what is going on with this and when will it be accessible?
There was a bug opened on the subject, anyone who has interest in this might consider promoting it.
Going to answer my own question, according to the response on the bug seems like the official answer is:
"We said it would be published but it wasn't, so just wait until we say it will be published again".
Are you trying to read messages or send them? It's still not possible to send them but reading them should work for any app now