Search Unity

Unity IAP UserCancelled event, but not really cancelled

Discussion in 'Unity IAP' started by Lisan, Aug 12, 2019.

Thread Status:
Not open for further replies.
  1. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Hi,
    I have many events of Unity.PurchaseFailed with "UserCancelled" reason, whitch i thought was normal, cause it's sent if user pressed Buy button in my game, and after OS brings out modal system purchasing window just closes it, changing his mind about purchase. But, i begin to get complains from users who are unable to buy my game even when they wanted to. One of them sent me a video:
    https://yadi.sk/mail/?hash=2CCo3NOZDG4yb3s99Zp3OFohQxmHY3VNvPRulRKPdceAReIgdSSkSKq8Nru8Pcogq/J6bpmRyOJonT3VoXnDag==

    It's in Russian, but behaviour understandable. After user taps "Buy now" button in modal system window, purchase does not proceeds further, but instead of this stays in this state (darken screen with activity indicator spinning) forever. Then he touch outside the window, and control returns to this window, after whitch the window is closed with Back button, and Unity.PurchaseFailed with "UserCancelled" returned. Unfortunatelly this user is not responding for now, and i can't get logs of this behaviour, but i begin thinking, that many of UserCancelled event in analitics actually not just player changes his mind, but user was unable to buy. Additional reason to think so is many users has many such events, not just one, so they had multiple attempts to buy, but in vain..
    Anyone experinced such thing? Anything can be done about it?
    Game is in Unity 2017.4.30, IAP 1.22.0, Android
     
    Last edited: Aug 12, 2019
  2. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,519
  3. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Thanks, but i don't know what to say to Google support. That user said, that he don't have any purchasing problems with other GP applications, only with my game. Doesn't this fact makes this Unity problem? Or, at least, problem with combination of Unity+GP under some unknown conditions. So, hardly this can be solved with Google support.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm if the affected users are all non-US?
     
  5. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    So far i have only one user who confirmed having this exact issue, and he is non-US. I had some other "can't buy" complains before, but part of them didn't get in touch to clarify details, and some of them ended up as payment method issues. But after a had video from this user i wonder how many "UserCancelled" events in analytics can be related to this, and not to actual cancelling.
     
  6. FoxsterDev

    FoxsterDev

    Joined:
    Oct 20, 2018
    Posts:
    5
    Hi
    It seems we also have the issue with fake users cancellation.

    is it ok to have transactionId and user cancelled callback?
     
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No, it is unexpected. We are looking into it.
     
    welling169 and FoxsterDev like this.
  8. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I still have problems with it with several users
    Simptoms are the same.
    Just now the next user wrote to me: "I want to buy your game, but can't do it. When i press "Buy" button game just hangs and nothing happens, and when i cancel, error message shown"
    Error message is on our code, and it shows the same "User cancelled" status. Unfortunatelly i can't have full log what happened there, but it's the same for many users, when they initiated purchase, initial window of Google Purchasing is shown
    http://joxi.ru/bmoYbaei34nRnA

    But after pressing "Purchase" there nothing happens.
    All users keep saying, that they have such problems only with our game, and purchased other apps in Google Play without problems, so it's not pure Google Play issue.
    User from Germany. Game is in Unity 2017.4.32, IAP 1.22.0, Android
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Purchase your game? That would not be IAP related. Do you mean purchasing products within your (free) game? Please don't include external links, attach here.
     
  10. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Yes, i mean purchasing the full version with iAP.
    Here is the image, it's just Google Play purchasing window grayed out.


    upload_2019-9-30_18-39-51.png
     
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Please provide the device logs. I believe I know what the issue may be though. Some users are seeing this behavior, but it looks to be Google account related. In the next release, we identify this condition and return InitializeFailed with an error code instead of polling continuously during initialization like you are seeing. When you receive this error, you will want to pop up a dialog to the user to check their Google account. I can reproduce by changing my password online, but not yet on the device. Others users claim they get the error for other yet undetermined reasons.
     
  12. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    It would be great to have logs, but we never got this error ourselves, only from customers, and i can't ask random woman from Germany to install Android SDK to get Logcat working.
    You think this is initialization issue? Maybe so, but i believe in this case user will have problems with other apps too. And more, if iAP can't be initialized correctly, it won't be initialized right from the start, right? But, if you look at video i posted from customer in the start of the thread, he has PRICE displayed on the green "buy" button inside the game. Which means, that iAP was initialized, product was registered, and price was fetched from Google Play, and it hangs not on initialization, but on purchase itself.
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes I understand it can be impossible to get client logs. But we either need steps to reproduce or the device logs. I've seen error:6 on purchases also, after initialization.
     
  14. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I see. Unfortunatelly i can't give you more info. Maybe some other users with the same problem would be able to do so. Cause adding new error code isn't a complete solution, it will just fix continuous polling, but users still won't be able to buy iAP, having no problems with Google Account in other apps (as they claim)
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ensure that they can log onto Google Play on the device. We are hearing reports unfortunately that even this doesn't always help.
     
  16. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Actually you can't be logged off Google Play like you can on iOs. In the Play Store app you can only switch account if there are more than one, but you can't "log off", so you always logged to one of them.
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, but I can reproduce the issue by changing my Google password online, but not yet on an unlocked device.
     
  18. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Also i have another case, maybe it's also connected to this thread case. Recently many users wrote to me "I purchased full version inside you game, i have money spent, but after it i got purchase error and full version wasn't unlocked"
    At first i thought, that it's maybe validation issue, but i managed to find one of such users in analytics, and he doesn't have validations error. In fact, he have the same "User Cancelled" error code returned from the purchase, and our server validator even was't called. Validator called from ProcessPurchase and it seems in this case ProcessPurchase wasn't called at all.
     
  19. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Understood that it can be difficult to troubleshoot these issues when we don't have specific steps to reproduce.
     
  20. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    We have no luck with it.
    Just the description of events from customer.
    She pressed "Buy" in the system Google Play window, activity indicator started spinning, she get notification sms of purchase, some time later activity stops spinning and system window closed, and she get purchase error in the game (which means PurchaseFailed was called), and in the analytics it has "UserCancelled" code, although user didn't cancel anything.
     
  21. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, we have heard several reports of this behavior. Whenever anything interrupt the purchase flow, perhaps like a biometric/fingerprint check dialog or similar, UserCancelled may be returned. We are passing along what is returned to us. That is our current theory, but still investigating.
     
  22. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I hope you will find the cause of the problem soon. The issue is rather massive, i get several complains in a week, and assuming not everyone will write something like "i want to buy, but can't", and most such users just won't say anything, we losing much money on it, cause most of the users expiriencing this bug get error before payment is complete. Though some of them get error after, like the case mentioned above. And our rating is decreasing because of it.
     
  23. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    The sooner we get exact steps to reproduce, the sooner we can address it.
     
  24. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I doubt, that it's possible at all. Only if you somehow will get one of devices, where bug occurs. Otherwise we have many users, we can ask them questions, but there are no "steps" for them, just something wrong in their device or in the way Google interacting with it. And i don't know how to get more knowledge on issue by questioning them. If you have thoughs, what else i can ask - i will.
     
  25. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yeah, it can be difficult/impossible to get additional information from customers, the hope is that you could try to reproduce on one of your devices. You might ask them if they received any system dialog popups or similar during the purchase flow which might explain the UserCancelled response.
     
  26. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    We will run another serie of tests after you release new iAP with fix for restoration (i believe it should be in a few days, right?).
     
  27. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We don't have a fix specific for restore. We are catching an account related error that usually shows up during initialization, but not sure yet what all triggers it. I can trigger it by changing my Google password online, but not yet on an unlocked device. But we are hearing reports that there may be other causes.
     
  28. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I mean another issue, that is discussed in another thread - purchases not restored on another device with the same account. You said there is a fix for it in the next release of iAP, which will be out in a few days, so we are waiting for it to run another testing session.
     
  29. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ah I see what you mean. Yes, that is correct.
     
  30. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Additional info here
    Today one of the users said following:

    "After pressing "Buy Now" screen became inactive and nothing happened for the long time, so we are cancelled the window and got "Purchase error". But then an idea came to mind, and i touched finger sensor right after pressing "Buy Now" and purchase was completed! "

    It seems, that on most devices there are intermediate screen with prompt to enter password or touch sensor right after "Buy Now" screen, but not on all devices, on some of them there is no such screen and no prompt at all, and screen just became inactive, and in this time user should figure out somehow, that finger sensor should be touched to proceed further. So to solve it, this info should be added to FAQ for the apps. Hope it will solve the issue.
     
  31. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes, the purchase flow that the stores provide seems to be fragile. Meaning, if a user touches outside the expected flow, UserCancelled is returned by the store API.
     
  32. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Actually i reproduced this on my own device, on several apps, including our own.
    Everything the same - after pressing "Buy Now" screen became darker and nothing happens without any message. If i put a finger on the sensor, purchase is completed. If i press outside of message frame, native interface is closed, and purchase failled with "User Cancelled"
    Since we were tired of users writing about it, and have no means to fix it, we just added "Press ? for more info about this error" to the error message, and the button, leading to the FAQ page on our site. This significally reduced complains.
     
  33. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is the Buy Now your button? Can you share some screenshots from the device? One trick is to use another phone to take the photos.
     
  34. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I don't know what else i can to add to all info posted before. I even posted video, not just screenshots.
    No, "Buy Now" is not my button, it's button on Google popup window.
    I can't catch 100% steps to reproduce yet, right now i can't.
    I have biometric authentication turned on, but for some reason sometimes after pressing "Buy now" in Google pop up purchase just finished without any authentication. In other time it doesn't, and it's there bug appears.
     
  35. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I don't click on external links for security, and I don't see the words "Buy Now" in any of the screenshots. Can you elaborate, "right now I can't". Can you explain why? Perhaps you just mean it doesn't happen all the time. Have you ever been able to reproduce? If so, could you try a few times, and if it reproduces, provide the device logs? We do agree that it looks like a valid issue, but we haven't been able to reproduce, so specific steps and/or device logs would be invaluable https://forum.unity.com/threads/how-to-capturing-device-logs-on-android.528680/
     
  36. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Yes, it doesn't happen all the time, i don't know why. Sometimes it happens, sometimes it's not. I'll try to capture it, but actually it happens even in native apps which has nothing to do with Unity at all. So i doubt you can fix it somehow, cause it's probably Google-related thing.
     
  37. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We discussed that very possibility yesterday, it does seem so. However, we are doing everything we can also.
     
  38. muratos

    muratos

    Joined:
    May 30, 2014
    Posts:
    3
    I also notice lots of userCancelled events along with successful purchases, after I implemented firebase logs a few days ago. I am sure that not all these users are cancelling, because there were insisting tries. I complete purchases successfully on my test devices so I can not reproduce it. I am using Unity 2018.4.6f1 and latest iap package 2.0.6. Should I also return a dialog stating that user should try with sensor?
     
    Haydar-AYDIN likes this.
  39. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Not sure what you mean about a sensor, but no. We are still researching, it appears that Google may put up (or attempts to display) a temporary "We are processing your purchase.." dialog that interrupts their own expected flow. We are still looking into it.
     
  40. muratos

    muratos

    Joined:
    May 30, 2014
    Posts:
    3
    Hello, Is there any progress with the issue? If it continues likes this, I will have to disable iap from my apps completely. People who can not buy also uninstall my apps. Is there a workaround?

    p.s: I use codeless iap if it helps to define problem.
     
    Last edited: Jun 1, 2020
    Haydar-AYDIN likes this.
  41. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    We are still working on this, no ETA yet
     
  42. muratos

    muratos

    Joined:
    May 30, 2014
    Posts:
    3
    I understand. I have currently 2.0.6 iap purchasing and 1.23.1 from asset store.
    Can you please suggest a stable iap version alongwith package version for 2018.4.6f1? I can even downgrade as a temporary solution if it will solve the problem.
     
  43. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
  44. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220

    Why don't you use my method, described above?
    After i wrote a FAQ about sensor behavior and start to point users to this FAQ on purchase error, i got less such complains.
     
  45. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I'm not sure what you are referring to, I don't any method that you are referring to. And what do you mean by sensor, do you mean biometric fingerprint security? Sorry I don't click on external links unless they are Stackoverflow, etc.
     
  46. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220

    Yes. I described it above. More than once. I failed to fix it somehow. But found a workaround, that when the screen goes dark, and there should be prompt to put a finger on biometric sensor (but there is no prompt due to bug, just dark screen), the user should put finger on sensor anyway and it works, purchase completed. Cause bug not in sensor itself, it's just in the mising descriptive prompt. But most of the users can't figure it out. That's why i made a descriptive message on purchase error with the link to FAQ on my webpage, where i describe this problem and how to solve it.
     
  47. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I've carefully read this thread, and you don't provide instructions or any FAQ link. Just now you mentioned both "I failed to fix it somehow" and then "where i describe this problem and how to solve it". You've never mentioned how you solved it. So you know, these dialogs are presented by the Android system by Google, they are not Unity dialogs. They are system dialogs. If you have solved the problem please describe your steps here in detail, without any external links.
     
  48. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    I just did it. The problem is user don't know how to complete the purchase. The solution to problem, is to tell user in the FAQ "If you see the black screen, put your finger on the sensor and purchase will be finished". That is the only solution i have, and it works, users almost stop to write about it.
     
  49. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It's not clear if they are just pressing the Home button to confirm a (possibly hidden) dialog, or performing a fingerprint ID. A user can choose to select fingerprint ID on some Android devices, we also thought this may contribute but could not reproduce. I understand what you are saying now, sorry for the confusion.
     
  50. charith11

    charith11

    Joined:
    Sep 29, 2017
    Posts:
    23
    I am experiencing same issue. all purchases came from other countries are stated as "payment declined". but when i tested it, it is working on real device. gameBug.PNG I don't know how to resolve this. did you resolve this completely? I attached image here.
     
Thread Status:
Not open for further replies.