FCM Notification to specific wordpress user

admin

Administrator
Staff member
i am developping an android application based on a wordpress blog where users can post their own articles, i work with WP REST API to get posts , comments and users ...

I would like to send a notification automatically to the user when his article got a new comment , i have installed FCM correctly and tested the simple forme of notifications but i need to :

<ul>
<li><strong>Trigger FCM Notification on new comment sent ( Or just on a button click )</strong> </li>
<li><strong>Specify receiver so the notification is sent to logged in user with the right email/username</strong></li>
</ul>

I thought of

<ul>
<li>working with setting User Property for every user logged like this : </li>
</ul>

<em>mFirebaseAnalytics.setUserProperty("user_name_for_notification", "the_username");</em>

<ul>
<li>Sending notification for all devices then handle it in <em>onMessageReceived</em></li>
</ul>

but i don't think those are good ideas

So , any ideas where to start

thank you