sendToDevicesOfUserIds method
Send an (unencrypted) to device message
of a specific eventType
to all
devices of a set of users
.
Implementation
Future<void> sendToDevicesOfUserIds(
Set<String> users,
String eventType,
Map<String, dynamic> message, {
String? messageId,
}) async {
// Send with send-to-device messaging
final data = <String, Map<String, Map<String, dynamic>>>{};
for (final user in users) {
data[user] = {'*': message};
}
await sendToDevice(
eventType, messageId ?? generateUniqueTransactionId(), data);
return;
}