question

Deekshith avatar image
Deekshith asked

Player Name in Push notification template/ Localization of Push notification messsages

<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?

CloudScriptPush NotificationsFriends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

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.

11 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Deekshith avatar image Deekshith commented ·

GetProfile API - It cannot be called from cloudscript, right?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Deekshith commented ·

You may use Entity API like GetProfile in Cloud Script function via entity.GetProfile()

0 Likes 0 ·
Deekshith avatar image Deekshith Seth Du ♦ commented ·

Could you give me an example on how to fetch the profile for a player with playfabid "ABC" in cloudscript?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.