Sending notifications to specific user


I have a chat in my app and I searched a lot in the internet for a tutorial on how to send a push notification when a message arrives, like WhatsApp. Is there anyway, using FCM or any other push notification service, to subscribe the notifications to an event?