I have a code snippet here to send a notification from a device to multiple devices:
public static void sendNotificationToUser(final String message) {
Firebase ref = new Firebase("https://danger-alarm.firebaseio.com/");
final Firebase notifications = ref.child("danger-alarm");
Map notification = new HashMap<>();
notification.put("message",message);
notifications.push().setValue(notification);
}
How my Firebase database looks like:
But the problem is, when I execute these codes, it doesn't send anything