question

dawidzielinskiprogrammer avatar image
dawidzielinskiprogrammer asked

Playfab Grant Item

Hey.

I have a problem cause I do not know how to grant item to Player by script.

I read this article https://docs.microsoft.com/en-us/rest/api/playfab/server/player-item-management/grant-items-to-user?view=playfab-rest but I do not understand that.

Can you please help?

My script right now:

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

I assume you are using Unity SDK, and here is an example --

        var request = new PlayFab.ServerModels.GrantItemsToUserRequest()
        {
            ItemIds = new List<string> { "xxxxx", "xxxxx" },
            PlayFabId = "xxxxxxxxx"
        };


        PlayFabServerAPI.GrantItemsToUser(request,
            onSuccess=> { },
            onFailed => { });
1 comment
10 |1200

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

dawidzielinskiprogrammer avatar image dawidzielinskiprogrammer commented ·

It's working as should. Thanks mate!

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.