GrantItemsToUser currently does not allow to set the quantity to be granted and asumes is always one. Multiple requests have to be created and send in order to grant items in amounts higher than one.
GrantItemsToUser currently does not allow to set the quantity to be granted and asumes is always one. Multiple requests have to be created and send in order to grant items in amounts higher than one.
I think this is a very much needed feature for a better and cleaner code.
Including the item's ID multiple times in the "ItemIds" array works pretty well, but it is not a great solution and it does not leave a very clean code in my opinion.
Thanks for posting it as a feature request!
Thanks to @Víctor suggestion, I tried adding multiple times the same item id, and it works correctly, even with stackable items (remaining uses are properly incremented by the number of times the item id is introduced in the list).
So while this is not a very elegant approach, it does indeed work perfectly for the purpose, and thus the request is no longer regarding a missing feature. I tend to think the request can be disregarded.
The request is still valid, please don't remove it. It's super ugly to include the item multiple times. Also, it's probably related to the PlayFab internal limits which prevent you from granting LOTS of items in one call. They say you shouldn't give more than 50 or the request can time out.
We don't remove requests unless they're not valid for the service. The updated Commerce service we're working to release later this year will have more flexibility where this is concerned. Meanwhile, one other thing you could consider is using the ModifyItemUses API call to add larger numbers of an item to a stack.
Share your great idea, or help out by voting for other people's ideas.
Request for New API that checks if provided IAP receipt is refunded and revoke related items
item custom data in Economy V2
Ad Placement - Smaller limit resets
Inventory V2 tab in characters in Game Manager
Automatic rewards for players after the leaderboard is reset
RedeemCoupon - Request to return currency