question

Phix Studio avatar image
Phix Studio asked

What is the code for calling the Update User Data? but for the publisher player data

i've made a game but i want to change some values and transport them from Player Data (title) to Player Data (Publisher)... How can i do that? and what is the code that i can use? (I'm on unity)

Player Data
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

·
Ivan Cai avatar image
Ivan Cai answered

If you want to change player data(title), you can update values via calling UpdateUserData API. After updating player data(title) successfully, you need to put the updated data content into the Data property of UpdateUserPublisherData API and call it. In your case, you can code it that calling server APIs in cloudscript, and call ExecuteCloudScript API to execute cloudscript function in unity's script . To use UpdateUserData in Cloud Script, I would recommend having a look at our samples: https://github.com/PlayFab/PlayFab-Samples.The Progressive Rewards sample is one that uses this API call.

10 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.

Phix Studio avatar image Phix Studio commented ·

Hi, thanks for answering me, so i can't update user publisher data without update user data for the title?

Can't I create a variable in Player Publisher data without define it into Player Title data?

0 Likes 0 ·
Ivan Cai avatar image Ivan Cai ♦ Phix Studio commented ·

In your case, didn't you update the data synchronously in the publisher data and player data?

0 Likes 0 ·
Phix Studio avatar image Phix Studio commented ·

can you show me an example of UpdateUserPublisherDataRequest? Because i don't see this definition in my script

0 Likes 0 ·
Phix Studio avatar image Phix Studio commented ·

Can i call UpdateUserPublisherData in unity? or only in cloud script?

0 Likes 0 ·
Ivan Cai avatar image Ivan Cai ♦ Phix Studio commented ·

You can also call client UpdateUserPublisherData API in unity.

0 Likes 0 ·
Phix Studio avatar image Phix Studio Ivan Cai ♦ commented ·

How? can you show me that?

what namespace i need and how to call it? cause i've tried but i not found the code

0 Likes 0 ·
Show more comments
Leonard Schultze avatar image Leonard Schultze commented ·

.

0 Likes 0 ·
Arnav Sanghavi avatar image Arnav Sanghavi Leonard Schultze commented ·

If someone is looking for an example this might help.

0 Likes 0 ·

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.