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.
Add Platform-Specific ID on Each Catalog Item for Receipt Verification
Documentation: Add an overview that explains and compares the main purchasing paths
Economy v2 - Bundles need better stack management
Allow annotation/custom tags on all PlayFab commands
Server API Allowed to Request Audit History Logs
New kind of inventory item: Entitlement/unlock/enablement/singleton items
Ability to create coupons economy V2.0