Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.

Conversation

dougflip
Copy link

This makes the error message consistent between Android and iOS.
Both will now report USER_CANCELLED when the user exits the IAP flow.

This makes the error message consistent between Android and iOS.
Both will now report USER_CANCELLED when the user exits the IAP flow.
@coveralls
Copy link

Coverage Status

Coverage increased (+1.1%) to 85.827% when pulling 65d1ecc on dougflip:issue-26/map-ios-errors into 27262e5 on AlexDisler:master.

@dougflip
Copy link
Author

@AlexDisler See what you think of this as a start. I only worked on the USER_CANCELLED/PaymentCancelled portion for now. Some of the other errors were hard to figure out how they would map. If this doesn't work as is maybe we can use it as a basis for a larger set of changes.

Also, I think this will technically be a breaking change since someone could be depending on the existing message in this instance. Maybe we want to consider adding a new property? Or maybe you are ready for a major version bump?

@AlexDisler
Copy link
Owner

AlexDisler commented May 18, 2016

Thanks for the pull request. I'd rather not have a special case for this error type and add mapping for all errors.

Yeah we could create a new set of errors that combine the errors from both platforms and have it as an additional property.

@dougflip
Copy link
Author

No problem! Ya, I agree it makes sense to get them all and creating a new property to preserve the original value sounds good as well. I'm hoping to have some time tomorrow to look at this again.

As for the mapping, some of the values seem straight forward from iOS to Android but some aren't as obvious. If we can get that nailed down here then I can get it into code:

Unknown -> UNKNOWN_ERROR
ClientInvalid -> ? (UNABLE_TO_INITIALIZE?)
PaymentCancelled -> USER_CANCELLED
PaymentInvalid -> ?
PaymentNotAllowed -> ?
StoreProductNotAvailable -> ITEM_UNAVAILABLE
CloudServicePermissionDenied -> ?
CloudServiceNetworkConnectionFailed -> ?

Any thoughts on the ones with question marks? Thanks!

@AlexDisler
Copy link
Owner

We can group them in the following way:

unknown:

Unknown
UNKNOWN_ERROR

cancelled:

PaymentCancelled
USER_CANCELLED

item unavailable:

StoreProductNotAvailable
ITEM_UNAVAILABLE

invalid request / invalid device setup:

PaymentInvalid
ClientInvalid
PaymentNotAllowed
BILLING_NOT_INITIALIZED
UNABLE_TO_INITIALIZE
INVALID_ARGUMENTS

purchase failed:

CloudServicePermissionDenied
CloudServiceNetworkConnectionFailed
VERIFICATION_FAILED
BAD_RESPONSE_FROM_SERVER

only relevant for Android:

ITEM_ALREADY_OWNED
ITEM_NOT_OWNED
CONSUME_FAILED

This should be good enough for the purpose of a general error and since we'll keep returning the platform specific errors as well, they can be used to debug the issue further on the relevant platform.

What do you think?

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

Successfully merging this pull request may close these issues.

3 participants