question

jrDev avatar image
jrDev asked

`PlayFab.ClientModels.GetPurchaseResult.Items' is obsolete: `Use '' instead' Warning?

Hello,

I keep getting this warning in Unity about the deprecated variable. But it is ambiguous to what it needs to change to. This is for the "items" line below.

PlayFabClientAPI.GetPurchase(request, (result) => {
				
				orderIDResponse = result.OrderId;
				paymentProvider = result.PaymentProvider;
				transactionID = result.TransactionId;
				transactionStatus = result.TransactionStatus;
				purchaseDate = result.PurchaseDate.ToString();
				items = result.Items;
}

Thanks,

jrDev

10 |1200

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

brendan avatar image
brendan answered

Actually, my apologies - that is indeed a deprecated parameter. But that said, a warning is not an error, and will not cause any failure in your game. If your build is halting as a result, I would have to guess that your warning level is set high enough to block execution.

2 comments
10 |1200

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

jrDev avatar image jrDev commented ·

Hey,

So is there a replacement parameter for result.Items?

Thanks,

jrDev

0 Likes 0 ·
brendan avatar image brendan jrDev commented ·

No, not currently. The issue is that due to things like stackables, there isn't an efficient way in the current model to return all the items from a purchase in the past. We're in the midst of working on a pretty significant change to the way inventory works under the covers - once that's in place, we'll be able to have a function that returns this data. For now, the data on items in the purchase will always be in the return from the actual purchase call, as well as the event for the purchase.

0 Likes 0 ·
brendan avatar image
brendan answered

I'm not sure why you would see that, as Items is not deprecated. Can you try creating a fresh project and importing the latest SDK, to see if you can reproduce this (and if so, can you please send us the project)?

7 comments
10 |1200

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

pumpjackgames avatar image pumpjackgames commented ·

Any Luck on this yet Jr?

0 Likes 0 ·
jrDev avatar image jrDev pumpjackgames commented ·

No, no luck. Apparently this i broken in the latest SDK...

0 Likes 0 ·
jrDev avatar image jrDev commented ·

Hello again,

So apparently in the latest version of the SDK version 2.21.170508, this throws an error now that stops Unity from running...

What happened in the SDK code?

Thanks,

jrDev

0 Likes 0 ·
jrDev avatar image jrDev commented ·

Update!

So I went to dig into the PlayFab scripts and found that PlayFabClientModels.cs line 2170-2171 looks like this:

  [Obsolete("Use '' instead", true)]
  public List<ItemInstance> Items;

This is what is causing the error. Is this a mistake @Brendan?

Thanks,

jrDev

0 Likes 0 ·
brendan avatar image brendan jrDev commented ·

Hm. I do see that, and I've opened a bug with the tools team to look into it. However, that would only produce a warning, which you can ignore - it would not block a build, nor would it cause a runtime error. So feel free to ignore it.

0 Likes 0 ·
jrDev avatar image jrDev brendan commented ·

Hey,

I don't know why, but it is throwing the error because I commented that section out and everything works ok after.


Thanks,

jrDev

0 Likes 0 ·
jrDev avatar image jrDev commented ·

Hey,

Any updates about this @Brendan?

Thanks,

jrDev

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.