Add a wrapper for simulatesAskToBuyInSandbox #349
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a way to use the simulatesAskToBuyInSandbox property of SKMutablePayment (added in iOS 8.3, tvOS 9.0). This property is intended to allow you to use a sandbox account to test how your app handles the situation where Ask To Buy is turned on for in-app purchases.
Details of Ask To Buy and testing it can be found at:
Unfortunately, from the last stackoverflow discussion, people are reporting that this property doesn't work as expected. My own testing with the iOS 11.2 SDK confirms this: even when the property is set when using a sandbox account, transactions are never reported in the deferred state. However, if/when Apple fixes this issue, then this wrapper functionality will allow it to be used.