N
N
Nick20152016-08-20 01:18:07
Android
Nick2015, 2016-08-20 01:18:07

Firebase, send notifications from one android device to another?

Hi everybody!
I came across an interesting article on Firebase on how to send notifications from one android device to another. With the part for android, everything is simple, the data is sent to the database. After that, this data will be sent as a notification to another android device. And there actually is Node code with which there are problems. how should i use it? Use the Firebase service and put the code there? (Perhaps it should be Firebase hosting? (as a database or as a hosting))
Could you give me more details on this topic, if possible, share literature (if you know such), or links to interesting publications.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Firsov, 2016-08-25
@FirsofMaxim

Hey!
I looked at the article, no special hacks are used there.
A small introduction, GoogleFirebaseMessaging uses the following types of messages:
1) downstream (per device, FirebaseID is used)
2) topic (sending devices subscribed to the topic_name channel)
3) upstream (message from the device)
The article uses the method of subscribing to the topic channel, each channel is formed a user based on some username, so if you know the username, you can send messages to it.
In order for you to get started, open https://firebase.google.com/docs/cloud-messaging/ and step by step:
1) Log in (register) to the GoogleFirebaseMessaging console
2) Create an application in the console
3) Create an Android / iOS application, connect the GoogleFirebase SDK with a JSON file from the console
4) Test on a real device in iOS (do not forget to create the necessary certificates and provision file), Android is much easier - you can on an emulator.
PS: For testing use POSTMAN to send requests to GoogleFirebase.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question