I am working on a module that needs to send push notification through FCM, I use Firebase Push Notification (FCM) for this purpose and it works well.
So what I need to do is to send a push notification when a node of specific content type is created, and it's solved through hook_entity_insert, but problem is that I have multiple languages on site, and it works only when the node is created the first time.
So my question is how to know when translation is created for the first time for a specific node?
For example:
- node is created on English (in hook_entity_insert I check if the node belong to specific content type and call a function to send the notification to all users that have English as user language).
- now when we add the translation for other languages, how I can know that it's the first time translation is created, and not updated one?