/// <summary>
        /// Revokes access to an item in a user's inventory
        /// </summary>
        public static void RevokeInventoryItem(RevokeInventoryItemRequest request, Action <RevokeInventoryResult> resultCallback, Action <PlayFabError> errorCallback, object customData = null)
        {
            if (PlayFabSettings.DeveloperSecretKey == null)
            {
                throw new Exception("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
            }

            PlayFabHttp.MakeApiCall("/Admin/RevokeInventoryItem", request, AuthType.DevSecretKey, resultCallback, errorCallback, customData);
        }
Beispiel #2
0
        public async Task RevokeInventoryItem(string playFabId, string itemInstance)
        {
            var reqRevokeInventoryItem = new RevokeInventoryItemRequest
            {
                PlayFabId      = playFabId,
                ItemInstanceId = itemInstance
            };

            var result = await PlayFabAdminAPI.RevokeInventoryItemAsync(reqRevokeInventoryItem);

            if (result.Error != null)
            {
                throw new Exception(result.Error.ErrorMessage);
            }
        }