In the Firebase Console it is possible to target devices using a specific app, language, version and user properties. Is it somehow possible to do the same with the API? Or is creating topics the only way to solve bulk sending notifications?
Basically what I would like to do is send a notification to all users with a specific language. I would use the console, but I need to set a click_action / category and that's not supported in the console (as far as I know).
There is no way within the API to select devices that match arbitrary criteria. You will have to figure out how to select the appropriate devices yourself. You have two options
One strategy might be to use topics that match the languages that you might wish to target. Client apps can subscribe to the topics that match their language preferences, and you can broadcast a message to them via those topics.
Another strategy might be to store language preferences for each user/device in your database (along with the device's token), then query for users/devices who have that language preference. Once you've collected all the tokens for the matching devices, you can send a message using only those tokens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With