question

Michael Romero avatar image
Michael Romero asked

Playfab iOS receipt validation for app review

Hello,

We have 2 renewable subscription products the player can choose to subscribe to in order to get access to our game's main content.

We've been going back and forth with Apple for a few weeks now, and for some reason, the purchase flow looks to fail for them. After a few submission builds, I'm being led to believe that they're getting a fail during the receipt validation step.

When players either choose "Join" or "Launch Game" (for players that are already members), we do the same exact logic path:

First validate that they already have a valid subscription:

1) Refresh player receipt and get it in base64 format (we use Prime31 store kit for this).

2) For each known known subscription product, get its centesimal value along with our base 64 receipt and call iOSValidateReceipt. We only expect fail callbacks to this (which might sound a little strange). The expected error codes for new players being ReceiptDoesNotContainInAppItems (altho any other error code would behave the same way, with the exception being SubscriptionAlreadyTaken) and returning players being SubscriptionAlreadyTaken. If we get the SubscriptionAlreadyTaken error code, we terminate this routine early.

If player has a valid subscription:

1) Just put them in the game, simple enough.

If player doesn't have valid subscription:

1) We put them through a parental gate, and only continue if they correctly answer all questions.

2) After parental gate, we show a native apple popup prompting them to choose which subscription product they wish to purchase.

3) We take their selection (which maps to a product id), and purchase it through Prime31's StoreKit. If the purchase is successful, we refresh the player's receipt, and send that receipt to Playfab via a call to iOSValidateReceipt with the proper centesimal value. If this is successful, we deem them subscribed and put them in the game.

Now that I've laid out the entire logic path for our purchase flow, is there a reason why this would only fail for the app review team? Our team has tested this numerous amounts of times with existing/new sandbox user accounts.

I would assume that the server implementation for iOSValidateReceipt would always hit apple's production endpoint, then fallback to their sandbox endpoint when doing the receipt validation. Is this correct?

I would greatly appreciate any helpful nudge to this. Thank you so much!

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

·
Citrus Yan avatar image
Citrus Yan answered

I am assuming that you are trying to implement the Subscription feature along with PlayFab, is that correct? Currently, Subscription support is not fully available for all developers, please keep an eye on the docs or blogs to get the latest updates, and, you may also create a support ticket in [GameManager] -> [Contact Us] to request it if you are in Pro or Enterprise tier.

ValidateIOSReceipt is used shortly after iOS purchase is done, to validate the receipt so that PlayFab service can grant corresponding items to the player’s inventory. Therefore, I think this section “2) For each known known subscription product, get its…” is problematic, that might be the reason why app review failed. To handle Subscriptions, this thread might help: https://community.playfab.com/questions/23890/subscription-and-auto-renewal.html , please take a look.

10 |1200

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

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.