77
Views
3
Comments
Solved
[Cloud Messaging Plugin (Firebase)] How to send notification to individual user
Question
cloud-messaging-plugin-firebase
Mobile icon
Forge asset by OutSystems
Application Type
Mobile

I have read through the documentation here: https://success.outsystems.com/documentation/11/integration_with_external_systems/mobile_plugins/firebase_plugins/firebase_cloud_messaging_plugin_using_server_actions/#enable-notifications

I have an existing Web app with a partnering mobile app. Currently we use the deprecated firebase forge components to handle this. 


However, I am looking to migrate to the Cloud Messaging Plugin, but it doesnt seem as obvious how to send a notification to a specific user. From the documentation there is a paragraph: 

"If you want to send the notification to specific users, note that these are identified by their Firebase Token, that can be obtained with the GetToken client action. You can find this ID on the Firebase Project Settings under the Cloud Messaging tab."

Firstly I presume there is an error here as the ID for each user is not available in the Firebase Project Settings. 


Secondly, The previous firebase plugins had a "middleware" module which seems to hold device information to be used. Am I correct in thinking we have to create that functionality seperately? Or is there an easier way to select a User (like in the screenshot below)



Any help would be appreciated.

2019-07-25 15-17-44
Christopher Robin-Kennedy
Solution

To answer my own question, I have had to create a PushMessagingUser entity which is populated with the userID and the token when the user registers the device, so I can send notifications to individual users. 

2021-02-17 18-31-05
Alexandre Jacinto
Staff

Hi @Christopher Robin-Kennedy,


To send a notification to a specific user, you can use the Firebase Token that is the output of the "GetToken" client action, since a user is identified by their Firebase Token.

Hope this helps.

Best regards,
Alexandre Jacinto

2019-07-25 15-17-44
Christopher Robin-Kennedy

Thank you for the reply. 


However, sending the notification server action is from a different application to the mobile app and therefore does not have access to the "Get Token" for that individual user. 

Does that mean I need to create an entity to map the tokens from each user to the User Id? 

2019-07-25 15-17-44
Christopher Robin-Kennedy
Solution

To answer my own question, I have had to create a PushMessagingUser entity which is populated with the userID and the token when the user registers the device, so I can send notifications to individual users. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.