0

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:

How my Firebase database looks like

But the problem is, when I execute these codes, it doesn't send anything

Frank van Puffelen
  • 499,950
  • 69
  • 739
  • 734
fant293
  • 13
  • 3

0 Answers0