I am assigned a task to use Firebase to implement push notifications but I am kind of new this.
Looking at the documentation:
https://firebase.google.com/docs/notifications/android/console-audience
I can't tell under what circumstances should I use send to user segment
or send to a topic
.
Can someone please give me some example when to use one or the other and point out the difference? Thanks ahead :)
User Segments
Topics
IMHO, if you want things to be quick and simple, go with Topic Messaging.
first you have to save the tokens for every single device you want to send notification to, I've saved them on a table call "FCM_TOKEN", then retrieve tokens (I'm using PDO) and send them using while loop like this:
Don't forget to close session curl_close($curl_session); this worked just fine for me.