On Firebase doc i can see this information
Client apps can send messages upstream to device groups by targeting messages to the appropriate notification key in the to field.
The following call to FCM sends an upstream message to a notification key. The object consists of key-value pairs.
FirebaseMessaging fm = FirebaseMessaging.getInstance(); String to = aUniqueKey; // the notification key AtomicInteger msgId = new AtomicInteger(); fm.send(new RemoteMessage.Builder(to) .setMessageId(msgId) .addData("hello", "world") .build());
I create a notification key, to send message. My notification key works when I use postman. But when I use the code above from my Android app, it doesn't do anything. I do not even get an error.
Numerous discussion here on SO is saying Firebase doesn't support device to device messaging. Like here or here or here.
But, my confusion arise from above documentation. What am I missing here?