How to send notification to specific users with FCM?
Did I need to create a web server
Yes. You need a place where you can map name/email to registration IDs. These registration IDs must be included in the request to FCM, for example
{
'registration_ids': ['qrgqry34562456', '245346236ef'],
'notification': {
'body': '',
'title': ''
},
'data': {
}
}
will send the push to 'qrgqry34562456' and '245346236ef'.
The registration ID you use in the call is the one that's called 'token' in this callback in the app.
public class MyService extends FirebaseInstanceIdService {
@Override
public void onTokenRefresh() {
}
}