Looks like the Admin NodeJS SDK only allows sending messages to device, group and topics. Device group management is not included though. so developers would need to use the the android APIs to do this (https://firebase.google.com/docs/cloud-messaging/android/device-group#managing-device-groups-on-the-app-server). It seems a bit fragmented, so it would be nice if the Admin SDK supports both areas and neatly hides the details.
+1
+1 This would also allow users to drop the legacy server API altogether (and long-lived auth keys).
Is device group management even supported by the new v1 protocol? I can't find any references to it.
@sampson-chen PTAL.
Feature parity here for device group management would be nice, I agree. However, it's not on the immediate roadmap. There's an ongoing discussion within the team, and I'll provide an update when available.
In the mean time, does the FCM Topics feature provide sufficient equivalent functionality for your use cases?
In the mean time, does the FCM Topics feature provide sufficient equivalent functionality for your use cases?
For reference, here's some of the features and limitations of _Topics_:
The last two points may pose a problem.
This sentence in the documentation is misleading:
You can use device group messaging with the Admin SDKs, or by implementing the XMPP or HTTP protocols on your app server.
Admin SDKs is only for sending to device group, not adding and removing a device in a group. So if I don't want to use both solution (Admin SDK to send and HTTP v1 API to manage device in group) I can "simply" loop admin.messaging().send for all tokens of an user and not use device group messaging at all?
How bad is this approach?
Thanks
@hiranya911 any hints?
@patricksebastien your suggested approach will work for a small number of device tokens. But it won't scale for large groups, as you will start bumping into FCM request quotas after a while. You should consider topics as an alternative. You can both send to topics and manage topic subscriptions from the Admin SDK. There's also some ongoing work by the FCM team to handle this type of use cases more elegantly.
Any updates on this?
I'm worried I'll run into the quota problem as described by @hiranya911
We have a proposal under consideration for implementing a new multicast/batch send API. I've already prototyped it for Java. Once the proposal is approved, it will be implemented here as well.
This would be a duplicated issue, see https://github.com/firebase/firebase-admin-java/issues/187
The FCM team is working on providing a group-equivalent feature and address the problem for topics mentioned in point 3 in the comment above: https://github.com/firebase/firebase-admin-node/issues/173#issuecomment-403805759
This would be a duplicated issue, see firebase/firebase-admin-java#187
The FCM team is working on providing a group-equivalent feature and address the problem for topics mentioned in point 3 in the comment above: #173 (comment)
@chong-shao any news on the progress of private topics?
There's no new updates I can share for now. Please stay tuned :)
Most helpful comment
This sentence in the documentation is misleading:
Device group
Admin SDKs is only for sending to device group, not adding and removing a device in a group. So if I don't want to use both solution (Admin SDK to send and HTTP v1 API to manage device in group) I can "simply" loop admin.messaging().send for all tokens of an user and not use device group messaging at all?
How bad is this approach?
Thanks