question

Jorge Ramirez avatar image
Jorge Ramirez asked

Cant find Signature with Unity IAB API

Hello playfab!

I have a problem with the new Unity IAB API and the playfab's ValidateGooglePlayPurchase method. I can make a purchase in Unity using the Unity IAB API, and it has a method (ProcessPurchase) where I can add any code I need when the purchase has been done. Now, when that happens, I want to give my user his bundle, and I use ValidateGooglePlayPurchase for that. I've already stared the Google service Add-on in Playfab, adding only the Google App Package ID (com.XXXXXXXXX.YYYYY) and the Google App License Key (xyz+XYZXYZXYZ/xYz...) but i didnt add any Google OAuth Client ID and Google OAuth Client Secret (I just added an '-') because here says i just need the firsts ones.

But, I can't find a variable that gives me a "signature" in PurchaseEventArgs . I have the receipt, but not the signature. I'm checking out this method too, but I'm limited with Unity methods. and I just receive this Error HTTP:400 InvalidReceipt -- Invalid signature. (The only clue I have is that is similar to the App liscense Key)

Hope you can help me with this one.

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The info you need is in this doc page: https://docs.unity3d.com/Manual/UnityIAPPurchaseReceipts.html.

In short, Unity provides the JSON of the receipt and its signature in the Payload they pass back. Using those should get you unblocked.

4 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.

Jorge Ramirez avatar image Jorge Ramirez commented ·

Totally correct, Thanks!! that was the only thing I needed. I didn't know the value in the payload was dependant of the store the player purchases, and I must connect both the Unity purchase procedure and the store billing procedure.

One last question, if I use ValidateGooglePlayPurchase(), the user receives the Bundle, or it is only an analytic procedure and the bundle must be another method call?

0 Likes 0 ·
brendan avatar image brendan Jorge Ramirez commented ·

They get the ItemId specified via the Product ID in the receipt. The point of doing receipt validation in a backend like ours is to ensure that the entire process is secure, so that players cannot get things they didn't pay for, but do get the things they did pay for. When you make the call to validate a Google Play receipt, we do a series of checks to ensure that the receipt is valid, for your title, and hasn't been used before, then we add the item to the player inventory - only after that do we return the response.

0 Likes 0 ·
Jorge Ramirez avatar image Jorge Ramirez commented ·

Thanks a lot!! this helps me a lot, and thanks for the patience.

0 Likes 0 ·
swapnilnegi avatar image swapnilnegi Jorge Ramirez commented ·

@Jorge Ramirez Hey even I am facing the same issue. So extracting the signature from payload helped you or how did you solve the problem.?

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.