question

brendan avatar image
brendan asked

Set User Read Only Data public in Cloud Script

Question from a developer:

Is there an example showing how to set a user ReadOnlyData key to Public via CloudScript?

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

·
brendan avatar image
brendan answered

No, but all you would need to do in our ReferralCodes sample (https://github.com/PlayFab/PlayFab-Samples/blob/06a887c04068091daaf9a8610d8f32092484b4e1/Recipes/ReferralCodes/CloudScript.js) is add that property to the call. So change this:

    var UpdateUserReadOnlyDataRequest = {
        "PlayFabId": id,
        "Data": {}
    };

To this:

    var UpdateUserReadOnlyDataRequest = {
        "PlayFabId": id,
        "Data": {},
        "Permission": "Public"
    };
10 |1200

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

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.