Hey guys, how can I pass the DisplayProperties for an item created using AddInventoryItemsAsync? Here is what my Azure Function currently looks like:
namespace UsurpatorCompany.UsurpatorFunction
{
public static class CMDAzureAddItemPlayerInventory
{
[FunctionName("CMDAzureAddItemPlayerInventory")]
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
var context = JsonConvert.DeserializeObject<FunctionExecutionContext<dynamic>>(await req.ReadAsStringAsync());
var api = new PlayFabEconomyInstanceAPI(context.ApiSettings, context.AuthenticationContext);
var itemFriendlyName =context.FunctionArgument["FriendlyName"];
var targetEntityId =context.FunctionArgument["TargetEntityID"];
var amount =context.FunctionArgument["Amount"];
var collectionIDString =context.FunctionArgument["CollectionIDString"];
var result = await api.AddInventoryItemsAsync(new PlayFab.EconomyModels.AddInventoryItemsRequest
{
CollectionId = collectionIDString,
Item = new PlayFab.EconomyModels.InventoryItemReference
{
AlternateId=new PlayFab.EconomyModels.AlternateId
{
Type= "FriendlyId",
Value= itemFriendlyName
}
},
Amount = amount,
Entity = new PlayFab.EconomyModels.EntityKey{
Id = targetEntityId,
Type=context.CallerEntityProfile.Entity.Type
}
});
}
}
}