Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Handle Apple NSUnderlyingError instead of failing on GeneralError when Terms & Conditions have changed #382

Conversation

RobinS-S
Copy link
Contributor

@RobinS-S RobinS-S commented May 6, 2021

For iOS only: Handle Apple NSUnderlyingError instead of failing on GeneralError when Terms & Conditions have changed

This message is shown when you enable 'interrupt purchases' in the Sandbox users on App Store Connect. When placing the purchase, PurchaseAsync is called and it returns a GeneralError. What actually is happening is Apple is refusing the payment to be made until the user accepts the updated Terms of Service.

image

To reproduce, please visit App Store Connect and navigate to the 'Users and Access' section. In the side menu, click Testers under Sandbox. Click or create a user and tick the box 'Interrupt purchases'. Log in and out of your Sandbox account from the iOS device and try to make a purchase. After pressing the blue 'Buy' button you will get this popup.

image

Fixes issue where the plugin returned invalid status for the payment. An app I submitted was denied for having shown an error message for this.

Changes Proposed in this pull request:

  • In case of SKError.Unknown, check for underlying NSError and check this with number 3038. There does not seem to be a constant within the Apple SDK for this. I found this by debugging and a thread on Apple's forums

Please tell me if I can make any corrections to my change or other ways of handling this are known.

A report on Apple forums: https://developer.apple.com/forums/thread/674081

@jamesmontemagno jamesmontemagno merged commit a85ae03 into jamesmontemagno:master May 6, 2021
@jamesmontemagno
Copy link
Owner

Should be in 4.2.0-beta

We actually could probably move it down a little bit....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants