Search Unity

Issue: Apple return Success but Unity IAP return UserCancelled

Discussion in 'Unity IAP' started by cuongnp, Mar 13, 2019.

  1. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    Hi,

    I'm having a problem when User makes a purchase request, Apple return Success but Unity IAP returns UserCancelled.
    Here is the clip from a customer to provide this issue:


    I'm using Unity 2017.4.9f1 Pro version.

    Does anybody have the same issue?
    Thank!
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please describe the steps you are taking, it looks like you are activating facial recognition? Does it work correctly when you don't do that? Just to better understand the issue. UI interaction during the purchase flow can indeed trigger the UserCancelled behavior, but we don't have control over the event handling as we are just a pass through service for the Apple API's. Make sure you are using the latest IAP version which is 1.20.1.
     
  3. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    @JeffDUnity3D Thank for your reply.
    >> Here is the step in the game:
    1. Click buy product in the game
    2. Apple return Success: You All Set popup
    3. Unity IAP return failureReason UserCancelled in OnPurchaseFailed Function
    4. We show an error popup in game.

    >> It looks like you are activating facial recognition? Does it work correctly when you don't do that?
    Our customer tried with entering the password but still get this issue.

    > Make sure you are using the latest IAP version which is 1.20.1.
    Yes, we are using IAP version 1.20.1

    Noted:
    - This user has been purchased this product in the past, after that, he requests a refund from Apple. This is a consumable product.
    - When we check his purchase data with Receipt and API https://buy.itunes.apple.com/verifyReceipt, we always see a data contain refund product.
    upload_2019-3-14_10-15-23.png
    - Sometimes he can buy this product, some time he got the issue.
    - I'm not sure if Unity IAP has any problem when verifying with Apple by this data.
     
    Last edited: Mar 14, 2019
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Does this happen for all users, for all purchases? Is this on TestFlight or in Production?
     
  5. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    @JeffDUnity3D
    >> Does this happen for all users, for all purchases?
    - It's doesn't happen for all users, but I'm not sure how many users getting this issue. Our server engineer is working on it.
    - For this user, it's only happen with this product_id : com.scopely.whiplash.iap_v20_9999

    >> Is this on TestFlight or in Production?
    It happens in Production.
     
  6. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    >> This product has been released for a long time. We tested this product_id a lot of time in TestFlight and this issue does not happen to all user.
    >> We tried to reproduce this issue but it's not happening.
    >> As I checked the log and our analytic, when this issue happens, Unity IAP Lib return UserCancelled in OnPurchaseFailed, after that, we show an error message.
    >> It's weird but this issue happens randomly, sometimes he can purchase this product.

    upload_2019-3-15_10-8-9.png
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Unfortunately without consistent steps to reproduce, there is no action that we can recommend at this time. We will continue to monitor this issue and see if any others might have steps to reproduce.
     
  8. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    @JeffDUnity3D Thank for your fast reply.

    Please let me know if you need any information.

    Thanks!
     
    Last edited: Mar 15, 2019
  9. ViceVice

    ViceVice

    Joined:
    Jan 29, 2018
    Posts:
    1
    Hi, I have exactly the same problem. Two customers reported the same issue as you described in last ten days. There was no problems earlier with same product (purchase). Have you made any progress?
     
  10. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Who was your question directed to? We are waiting for steps to reproduce and/or device logs when the issue occurs.
     
  11. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    We provided the clip from Customer, our QA still cannot reproduce it.
     
  12. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you test with fingerprint or facial recognition? Or check with the customer perhaps? Just a hunch...
     
  13. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    Our QA team tested with both fingerprint or facial recognition but everything was fine.
    The temporary solutions are created the new one productID so the customer can buy it.
     
  14. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Any other steps to reproduce, if possible, would be helpful. So they get an error only on this one product? But other purchases work ok? Are you displaying the error to the user? Did they try to purchase initially?
     
  15. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    Step in the clip customer sent are:
    1. Click buy product in the game
    2. Apple return Success: You All Set popup
    3. Unity IAP return failureReason UserCancelled in OnPurchaseFailed Function
    4. We show an error popup in game.

    > So they get an error only on this one product?
    Yes, the other product works fine.
    Notices that the error product is consumable and this user requested Apple to refund before.

    > But other purchases work ok?
    Yes

    > Are you displaying the error to the user?
    Yes, after IAP SDK returns UserCancelled in OnPurchaseFailed Function
     
  16. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So if the user requested a refund previously, I suspect Apple won't let the user buy it again. If this is the only product that is seeing the issue, and the user was able to purchase originally, this could well be the case. Do you expect a user to be able to purchase again, if they requested a refund previously? I would not, sounds like the user is trying to get free products.
     
  17. cuongnp

    cuongnp

    Joined:
    Aug 30, 2017
    Posts:
    10
    I agree with you, but the problem is the User still can purchase success with Apple store and Unity IAP return failed (UserCancelled).
    They lost money but get nothing!
     
    Last edited: May 23, 2019
  18. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So you are not able to reproduce yourself in your testing, after doing a refund? You are able to properly purchase the product a second time, after the first was refunded?