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
  • 565,676
  • 79
  • 828
  • 807
fant293
  • 15
  • 5

0 Answers0