There is such a task. The user starts the application and the first thing he chooses his city. It is necessary that users in a firebase somehow be divided into cities, and then push notifications are sent to these groups. Each group separately. How can this be implemented?
1 answer
First you need Firebase Database. Read more here . In the database you will need to record the city of the user and his FCM registration token , with which you can send a notification to a specific device.
How it will happen: you get all the tokens of users of a particular city from the database, then send notifications to these tokens using Firebase notifications.
PS I did not use notifications from Firebase, but I think it is realizable in a similar way.
- Thank! And how is it possible to process all tokens from the database immediately? That is, to take all the tokens of the city and send them a notification at once - Bullshit
- @Bullshit for this you need to handle tokens programmatically. Read this at stackoverflow.com/questions/37398898/… - Maxgmer
|