<Profile.DisplayName> can be used in push notification template but this will give the name of the player whom the notification is been sent.
I am implementing a friend system so when player A sends request to player B, player B should get notification which has name of player A.
How can this be achieved with push notification template?
If it cannot be achieved with this then how can language be fetched for user(which is been set in playfab) in cloudscript and based on the language , we can set custom messages and use SendPushNotification API. Is there any way to get player language in cloudscript?
Answer by SethDu · May 29, 2020 at 03:20 AM
In terms of this scenario, a feasible workaround solution is to implement the function in Cloud Script/Azure function where you may manually craft the contents and call SendPushNotification API like you have stated.
There are language settings in players’ profile, you may retrieve information via GetProfile API. In the meantime, you may also consider storing language config anywhere else, for example, Player Data.
GetProfile API - It cannot be called from cloudscript, right?
You may use Entity API like GetProfile in Cloud Script function via entity.GetProfile()
Could you give me an example on how to fetch the profile for a player with playfabid "ABC" in cloudscript?