1

How do I send notification from an android device to another device through firebase cloud messaging? I do not want to use the administrative panel of firebase for sending notifications, I just want to send from one device to the other.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

1 Answers1

1

FCM doesn't provide device to device communication, you will have to achieve through App Server or use FCM endpoint to send messages.

Do you have App Server implemented? which sends notification through FCM.

Approach 1: If App Server is there then you can follow: https://firebase.google.com/docs/cloud-messaging/android/upstream and add logic in App Server to send notification.

Approach 2: You could use Firebase Remote Config to share FCM server keys, and make Http request from android client.

Prakash
  • 4,479
  • 30
  • 42
  • Hello, I found a ready api in php that solves the problem I have, through a tutorial available on the AndroidHive website, I will create the app from it. But I just want notification to be sent from one device to another. Follow the api link if you can look: https://drive.google.com/file/d/1EIb5cTFABnjpdBr1BG5EiX2blOa5cNSB/view?usp=sharing – Thaynan Breno Jan 31 '19 at 22:25