What is the SKPaymentTransactionStateDeferred flow

2020-06-09 04:20发布

问题:

With iOS8, Apple introduced the new SKPaymentTransactionStateDeferred state for IAP transactions. (e.g., see https://developer.apple.com/library/ios/technotes/tn2259/_index.html). Amongst various issues with this (like, how do you test this!?), I don't know what the flow of Apple alerts looks like with this state. For example, when your app gets the SKPaymentTransactionStatePurchased state, Apple has just given a message "Thank You. Your purchase was successful." What about with the deferred state? Does Apple give the user (e.g., a child) an alert message? If so, what is it? If Apple doesn't give an alert, I certainly want to do this.

I guess I could create a new Apple Id for a fake child, and set it up as me being the parent of this fake child.

Anyone seen how the deferred state works in the production environment?

回答1:

It seems I've found the answer, looking in the docs for Ask to Buy (https://support.apple.com/en-us/HT201089). Apple explicitly includes in-app purchases in those docs, and say that the user (a child) is given the alert:

So it would seem clear that I don't have to put up an alert of my own!

Presumably, the wording of the alert differs for IAP's-- I'd still like to see what that specific message looks like.

Note 1: See How to test SKPaymentTransactionStateDeferred? for an example of what the IAP alerts look like in the sandbox.