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.
Asked
Active
Viewed 809 times
1
Doug Stevenson
- 268,359
- 30
- 341
- 380
Thaynan Breno
- 11
- 1
-
The question is quite broad at the moment. Try adding more details and any relevant code that might be useful to others. Also make sure to check out [ask] and [help] for more info. – 0xCursor Feb 01 '19 at 02:12
-
1Friend, the question is simple and objective. I just want to know how to send notification from one device to another via FCM via an api in php. – Thaynan Breno Feb 01 '19 at 02:20
-
https://stackoverflow.com/a/67974553/1065226 – Liker777 Jun 14 '21 at 17:23
1 Answers
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,261
- 27
- 38
-
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