How to support PurchaseFailureReason.Unknown?

Hi,

some of my users encountered PurchaseFailureReason.Unknown, and contacted me what is wrong. I’m clueless what should I say to them, as UNITY IAP DO NOT PROVIDE DETAILS on this error of any kind.


I can’t really say them what you have on documentation: “A catch-all for unrecognized purchase problems.”
I can picture something like: “Dear user, it could be anything, really. Have a good day.” - just kidding.

If a marker recognition is flickering, or some Ad fails to load, I can accept that easily. But when one of my users recognize value in my game and WANT TO PLACE AN ACTUAL PURCHASE, I think it should work. If it does not, at least we should know why.

Please help, WHAT IS THE ERROR, how can the user resolve it.

For inspiration, you people really should take a look at a typical NSError on iOS**.** It has: an error domain, a description, an array (!) of recovery options, a recovery suggestion, and a failure reason. All localized, full sentences. On every error. Errors happen, but information do help.

@ap-unity @JeffDUnity3D
(wow, seemingly you supported Remote Settings as well yesterday, thanks for that, but maybe you should expand the team, just a thought)

1 Like

In UnityPurchasing.m, Unity IAP SWALLOW ALMOST EVERY ERROR INFORMATION from the NSError, keeping error codes only. Keeping 3 error codes only out of 9.

- (NSString*)purchaseErrorCodeToReason:(NSInteger) errorCode {
    switch (errorCode) {
        case SKErrorPaymentCancelled:
            return @"UserCancelled";
        case SKErrorPaymentInvalid:
            return @"PaymentDeclined";
        case SKErrorPaymentNotAllowed:
            return @"PurchasingUnavailable";
    }

    return @"Unknown";
}

If you take a look on StoreKit documentation, you can see these:

SKErrorUnknown
Error code indicating that an unknown or unexpected error occurred.

SKErrorClientInvalid
Error code indicating that the client is not allowed to perform the attempted action.

SKErrorPaymentCancelled
Error code indicating that the user cancelled a payment request.

SKErrorPaymentInvalid
Error code indicating that one of the payment parameters was not recognized by the App Store.

SKErrorPaymentNotAllowed
Error code indicating that the user is not allowed to authorize payments.

SKErrorStoreProductNotAvailable
Error code indicating that the requested product is not available in the store.

SKErrorCloudServicePermissionDenied
Error code indicating that the user has not allowed access to Cloud service information.

SKErrorCloudServiceNetworkConnectionFailed
Error code indicating that the device could not connect to the network.

SKErrorCloudServiceRevoked
Error code indicating that the user has revoked permission to use this cloud service.

I am UNABLE TO DIFFERENTIATE between these error, and the only reason is because I’m using Unity IAP. I’m clueless, my customer is clueless. Unity IAP is a stream of frustration, to be honest.

1 Like

Are you serious?
I took a deeper look, and it seems most of these failure reasons in your documentation simply are NOT HOOKED UP:

PurchasingUnavailable The system purchasing feature is unavailable.
ExistingPurchasePending A purchase was already in progress when a new purchase was requested.
ProductUnavailable The product is not available to purchase on the store.
SignatureInvalid Signature validation of the purchase’s receipt failed.
UserCancelled The user opted to cancel rather than proceed with the purchase.
PaymentDeclined There was a problem with the payment.
DuplicateTransaction A duplicate transaction error when the transaction has already been completed successfully.
Unknown A catch-all for unrecognized purchase problems.

You have to stop what you are doing. I’ll contact Unity directly.

@eppz Thank you for the feedback, I will bring this up with the IAP team today, and will update this thread.

2 Likes

@eppz ,

I completely agree that we should provide as much information as possible. I will pass this feedback along to the team.

I was able to find all of these error codes used in the UnityPurchasing.m file, with the exception of SignatureInvalid and ExistingPurchasePending, which is expected. (As you know, Unity IAP is cross-platform, so not all of the errors listed on the PurchaseFailureReason will be relevant for iOS.)

Taking a look at the SKError list, three of them are concerning Cloud Services which our IAP plugin does not use. Of the remaining six, we are only catching four; SKErrorStoreProductNotAvailable and SKErrorClientInvalid are not caught and would be marked as Unknown. However, before we initiate the purchase on the StoreKit side, we are checking if the product is available and if purchasing is allowed. If not, the relevant error will be thrown. So we are not catching those SKError specifically, but we should be handling those situations.

The vast majority of the time, if Unity IAP shows an Unknown error, it’s because StoreKit returned an Unknown error. The response we get from StoreKit is always available in the device log. I understand that if this happens on a customer’s device, then it makes it even more difficult to track down the exact cause.

We have brought your concerns to the IAP team and they will reevaluate how they are handling iOS errors and whether we can provide more information to developers.

1 Like

Thanks for getting back!

I looked into my analytics: ~20% of my purchase attempt events end up on this “Unknown” error. Which is a huge number. And only 1% of them attempted to retry and manage to place the purchase. I’m actually losing revenue, and have not idea why.

It affects 0,3% of all users, but 7% of users with purchasing events (every iOS from 10.3.2+, ). Lost revenue, without any explanation.

I would like to fix it actually instead of support it, but I have no starting point at all.

You should make analytics campaign to log these type of errors. Given that Unity has an enormous user base, tracking it down / correlate with factors would be easier for you. I could not move the needle even if I try to patch Unity IAP.

@eppz The Unknown error is returned to us by Apple in most cases, and we have no control over this.

Well, today I have another customer message, saying: “I like the game, but I can’t buy <SOME_IAP>, please help”.

I told her that I’ll look into analytics, but I’m pretty sure it will be unknown error. She has her payment details right, also she can purchase other stuff in other games. This is eternally frustrating.

Am I the only person experiencing this issue?
Why you people just pretending that this is all normal?

She could not purchase a particular product (A).
She could successfully purchase other products in the game.
Others can purchase the particular product (A) just fine.

I’ll patch Unity IAP, and make analytics every error message.
Is there any additional factor I should make analytics of?

The error message they are receiving would be helpful, if it is possible to obtain. Is this the only user not able to buy product (A)?

It seems not product dependent, as I can see every product purchased in my analytics.

I can get the error message by
-Patch Unity IAP to pass on every NSError property,
-Dispatch the values to Analytics,
-Release an Update to the App Store.

So it will take time. :frowning:
And further lost profits.

Since then, she added: “…it is quite frustrating when you getting the hang of the game, then you have to accept that you can’t buy more levels…”. This is a nightmare. Reading emails like is devastating.

Just to add : we are seeing the same issues as described here in our live builds also (Unity 2018.1.0b11 + Unity IAP 1.17.0). I am able to repeat this 100% of the time with my personal Apple ID in our app. The issue does not occur for other users here using the same live build - it seems somewhat account specific. Purchasing from any other apps using my personal Apple ID works fine.

1 Like

We are continuing to look into this. I am investigating a possible scenario where the user is logged into the iTunes store vs not logged in, prior to an in-app purchase.

Update: my account is now able to purchase without problem and the issue appears to have resolved - something must have changed externally as we have made no changes on our side.

These threads, some a bit old, do mention a connection between the Unknown error and App Store/iTunes login :

https://forums.developer.apple.com/thread/75044

https://forums.developer.apple.com/thread/28675

So I should advise the users to simply log out, log in, then retry?

@eppz That is a possible approach, but is not guaranteed to help if it is an ongoing issue with Apple. One article mentions the need to confirm iTunes Terms and Conditions if a recent update was performed. We are continuing to discuss here also. It is difficult to diagnose without a consistent repro scenario that we can test with here.

1 Like

@JeffDUnity3D Wow, Terms and Conditions update seems kind of fit the symptoms. Not everyone experiences, not every time, no product or account dependency.

Terms and Conditions update seems a good fit, but for testing, it would be great to know when the next update will be performed. The corresponding tests could be carried out then.

Agreed, you would want to ask Apple about their schedule with regard to iTunes updates. But keep in mind this is only a theory, and an iTunes update can happen for any user at any time if they haven’t used their phone for awhile, for example. If you have a user that can confirm T&C behavior, it would be helpful to know.

I am also seeing this issue. I have a device that repros this 100% of the time, but only a small section of my users are seeing the issue.