Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

IAP restore issues (Android)

Discussion in 'Unity IAP' started by DanWeston, Mar 31, 2019.

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

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want to test with a subscription and not a non-consumable, but for now, I think you should wait for the next release. Restore is indeed when ProcessPurchase is (automatically on Android) triggered which is currently not happening on the second device (a bug). It seems you've additionally concluded that receipts are also not showing up, we will look into that also.
     
  2. tessellation

    tessellation

    Joined:
    Aug 11, 2015
    Posts:
    390
    We don't currently have any subscription products, but I would hope UnityIAP would work with non-consumables regardless. I hope the next release fixes it. Thank you.

    Thanks for looking into it.
     
  3. i_nakajima

    i_nakajima

    Joined:
    Jan 26, 2018
    Posts:
    1
    hi,
    I am using latest version of unity IAP 1.23.1

    I want to check the operation when calling the function
    IGooglePlayStoreExtensions.RestoreTransaction(Action<bool> callback).

    ProcessPurchase() after callback is called.

    Is this correct behavior?

    All products are non-consumable.

    iOS
    ProcessPurchase() before callback is called.

    Log

    01-27 18:03:56.784: I/UnityIAP(9649): invoking callback
    01-27 18:03:56.784: I/UnityIAP(9649): Querying owned items, item type: inapp
    01-27 18:03:56.784: I/UnityIAP(9649): Package name: com.mypackage.google
    01-27 18:03:56.784: I/UnityIAP(9649): Calling getPurchases with continuation token: null
    01-27 18:03:56.793: I/UnityIAP(9649): Owned items response: 0
    01-27 18:03:56.793: I/UnityIAP(9649): Sku is owned: sample.google.product1
    01-27 18:03:56.793: I/UnityIAP(9649): Sku is owned: sample.google.product2
    01-27 18:03:56.793: I/UnityIAP(9649): Sku is owned: sample.google.product3
    01-27 18:03:56.793: I/UnityIAP(9649): Sku is owned: sample.google.product4
    01-27 18:03:56.793: I/UnityIAP(9649): Continuation token: null
    01-27 18:03:56.793: I/UnityIAP(9649): Querying SKU details.
    01-27 18:03:56.914: I/UnityIAP(9649): Querying owned items, item type: subs
    01-27 18:03:56.914: I/UnityIAP(9649): Package name: com.mypackage.google
    01-27 18:03:56.914: I/UnityIAP(9649): Calling getPurchases with continuation token: null
    01-27 18:03:56.978: I/UnityIAP(9649): Owned items response: 0
    01-27 18:03:56.978: I/UnityIAP(9649): Continuation token: null
    01-27 18:03:56.978: I/UnityIAP(9649): Querying SKU details.
    01-27 18:03:56.978: I/UnityIAP(9649): queryPrices: nothing to do because there are no SKUs.
    01-27 18:03:56.978: I/UnityIAP(9649): Querying owned items' purchase history, item type: subs
    01-27 18:03:56.978: I/UnityIAP(9649): Package name: com.mypackage.google
    01-27 18:03:56.978: I/UnityIAP(9649): Calling getPurchaseHistory with continuation token: null
    01-27 18:03:57.077: I/UnityIAP(9649): Purchase history response: 0
    01-27 18:03:57.078: I/UnityIAP(9649): Continuation token: null
    01-27 18:03:57.078: I/UnityIAP(9649): Querying owned items' purchase history, item type: inapp
    01-27 18:03:57.078: I/UnityIAP(9649): Package name: com.mypackage.google
    01-27 18:03:57.078: I/UnityIAP(9649): Calling getPurchaseHistory with continuation token: null
    01-27 18:03:57.180: I/UnityIAP(9649): Purchase history response: 0
    01-27 18:03:57.180: I/UnityIAP(9649): Continuation token: null
    01-27 18:03:57.181: I/UnityIAP(9649): RestoreInventoryFinished: true
    01-27 18:03:57.181: I/UnityIAP(9649): Inventory refresh successful. (response: 0:OK)
     
    Last edited: Jan 27, 2020
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    ProcessPurchase would always be expected to be called AFTER restore is initiated. Note that Android does auto-restore on app install/reinstall.
     
  5. edmusayelyan

    edmusayelyan

    Joined:
    Nov 14, 2017
    Posts:
    2
    Hey guys. I'm using latest version of IAP version 2.0.6 with Unity 2019.2.18f1 and I have same issue. I'm installed same APK to two different devices with same Google/Google Play account. I have bought few products in First device and it doesn't restore that products on Second device. Maybe you have fixed this?
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Not yet, but should be in the next version release, hopefully in a few weeks.
     
  7. edmusayelyan

    edmusayelyan

    Joined:
    Nov 14, 2017
    Posts:
    2
    Thanks. Really waiting for this :)
     
  8. haiduongbk

    haiduongbk

    Joined:
    Oct 5, 2015
    Posts:
    6
    Hi JeffDUnity3D . when can we get a new version that can fix issues restore on multi devices?
     
  9. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Yes! We are working on this, hopefully within a few weeks.
     
    Last edited: Feb 4, 2020
  10. pertz

    pertz

    Joined:
    Jan 8, 2015
    Posts:
    106
    Any news?

    In a few weeks this issue turns 1 year old, yay. My players are so happy.
     
    Berno, Kennai, Olivier-Tache and 3 others like this.
  11. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    I also encountered this issue today. -_-
     
  12. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Any new estimates on this?
    So tired to cancel orders every day.
     
  13. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    40
    Just give up and downgrade that's what I've done.
    Who knows if the next release will get it right either?
    My app has been using the IAP package 1.19 and despite being told I didn't need to I downgraded within the package manager I went back to version 2.0.3.
    I don't get this issue with this combination of versions.
     
  14. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    Don't get your hopes up. I always used version 2.0.3 and still have the same problem.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    2.0.3 is not the IAP version, the current IAP version is 1.23.1. I believe you are referring to the Purchasing package in Package Manager. IAP uses both, but the version convention we use has the 1.x.x naming. If users on this thread are having issues, please specify which IAP version works for them, and which does not. That is, is Restore working on 1.19 but not on 1.23.1 ?
     
  16. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    Package version is 2.0.3 and IAP version is 1.18. I never tested any newer versions since until recently I didn't even know this problem exists. One week ago a user notified me that IAP they bought in my game in the past cannot be activated (due to "duplicate transaction" error) on a different device despite being logged in from the same Google Play account. That person used a game compiled with IAP version 1.18/package version 2.0.3.
     
  17. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Does this also occur in your testing with IAP 1.18, using two Android devices? I was able to restore on the second device by clearing the Google Play cache first. We are in touch with the Google dev team, and it looks like it may be an issue in their API.
     
    Last edited: Mar 10, 2020
  18. Ukounu

    Ukounu

    Joined:
    Nov 2, 2019
    Posts:
    209
    I didn't test it personally on two different devices yet, sorry. I have only one Android phone right now. I know about this problem only through report from a user who tried to activate an IAP in my game after getting a new phone.
     
  19. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    40
    I rolled back in a release back in September and it fixed this particular issue.
    There was always an issue where the odd user would loose purchases but those are fixable by clearing the Google Play cache.
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Which release?
     
  21. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    40
    I meant a release for my app.
    I had been having the issue of purchases not applying on multiple Android devices however I released an update with the downgraded IAP versions I mentioned and the problem seems solved.
     
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Which IAP version is currently working for you? 1.17, 1.18, 1.19 or 1.23.1 ?
     
  23. Berno

    Berno

    Joined:
    Oct 29, 2014
    Posts:
    40
    I took your advice and rolled back to IAP 1.19.
    At the time you said it was unnecessary however I also rolled back the package to "com.unity.purchasing": "2.0.3".
    Since I released this update to my app in September I haven't heard from any customers on Android able to double purchase across devices with the same account.

    If its of any help my app is listed here:
    https://play.google.com/store/apps/details?id=com.PyrofrogStudios.DashPanel&hl=en_AU
     
  24. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there! I'm still getting messages from users, that on second device with the same google account they can't get bought items.
    Latest IAP, Unity 2019.2.21f, Google Play store.
     
  25. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    That is correct, and is the issue being discussed here. It appears to be an issue with the Google Play API, you can try having the users clear their Google Play cache.
     
  26. Deleted User

    Deleted User

    Guest

    Hi @JeffDUnity3D having users clear their Google Play cache actually makes the issue manifest itself even worse. Clearing the cache will remove any active transactions from the user's purchased device, and no way to restore them. Thats what we have been seen in our testing, and from some direct feedback from our users.
     
  27. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you describe a bit more what you mean by "active transactions"? This is not what we are seeing in our testing, clearing the cache ALLOWS restore to occur. Simply reinstalling your app should reinstall any non-consumable or subscription products.
     
  28. Lisan

    Lisan

    Joined:
    Jun 17, 2009
    Posts:
    220
    Jeff, can you, please, keep us posted on progress on the matter?
     
    justtime likes this.
  29. SamOYUnity3D

    SamOYUnity3D

    Unity Technologies

    Joined:
    May 12, 2019
    Posts:
    626
    We have confirmed the problem with Google and will be notified here once it is fixed.
     
    justtime, joescott and PavelDoGreat like this.
  30. haiduongbk

    haiduongbk

    Joined:
    Oct 5, 2015
    Posts:
    6
  31. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Can you confirm if clearing the Google Play cache first on the second device works for you? Granted not a solution, but something to check.
     
  32. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    118
    We've been dealing with this issue since last last year in one of our games. Any word on a fix? Within "a few weeks" of late January it says above... I'm ?glad? to hear that it's not just our app.

    We have an open issue with Google about it and will be sending them some more data soon. Is there a ticket number you have on their side I can mention to get our case associated?
     
    nemeth-regime and bhushan_rathod like this.
  33. nemeth-regime

    nemeth-regime

    Joined:
    Feb 13, 2017
    Posts:
    40
    Yesterday I pushed an updated to the play store and today I realized that all 3 of my test devices using the latest version of my app no longer recognize previous purchased non consumable. Clearing google play cache did nothing and of course the re-purchased non-consumables on one device did not show up on other test devices using the same account.

    So for me it seems that the situation has gotten worse as it is now affecting devices where the non-consumables were originally purchased after my recent app update.

    I just hope that this a freak occurrence on my own account else the implications could be massive.

    IAP 1.23.1
    In App Purchasing 2.0.6
     
  34. Nananaaa

    Nananaaa

    Joined:
    Jul 24, 2016
    Posts:
    31
    This issue is now 13 months old... Any news about it?
     
    justtime, pertz and DarekRusin like this.
  35. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    424
    Hi there! Any ideas when it will be fixed? I've lost a lot of money and users due to this issue :(
     
  36. DarekRusin

    DarekRusin

    Joined:
    Nov 15, 2013
    Posts:
    47
    Also, if the fix is not planned to happen soon, is there any version that was bug free for basic consumables on iOS, Google and Amazon?

    We're still on 1.17 and there are cases (on Amazon especially) where money was taken from user, but never reported to the game. Reading all this I'm scared to upgrade and make things worse...
     
  37. vlater

    vlater

    Joined:
    Jun 4, 2013
    Posts:
    18
    I have the same issue, I've been testing IAP purchasing on a blank project and even when I delete google play store data - it invalidates my non-consumable purchase. No receipt when I checked. Before I deleted the data - it was working as expected on a single device. Looks like it is caching the purchase information somehow, doesn't sync with google play and when I clear the data the purchase disappears

    Unity: 2019.3.9f1
    In App purchasing package: 2.0.6
    Unity IAP 1.23.1
     
  38. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    You mean restoring on a second device? Don't clear the cache on the first device. When you reinstall the app on this first device, restore should happen and ProcessPurchase should fire. The bug is only when installing on a second device, we are still working on this.
     
  39. vlater

    vlater

    Joined:
    Jun 4, 2013
    Posts:
    18
    Yes, restoring on the second device doesn't work. This was my initial test. After that I found out that wiping the "Google play store" data does the same and thought it might be the same problem. Other games from the store (not mine) doesn't seem to be affected, and they restore purchases, but didn't test many games

    Update:
    After I've installed version Unity IAP 1.17 (as someone mentioned in this thread), it started working as expected. After I cleared the Google play data - the product receipt disappeared, but after that I clicked on purchase - google warned me that I already own this item (this is desired behavior, unlike 1.23.1 where I'm allowed to duplicate the purchase). After that I restarted the game and the receipt was there.
    For the test I'm using the IAP demo scene, with my non-consumable product

    Update 2
    After a little more testing (all tests are made after wiping out Play store data)
    Purchases made by IAP 1.17 are:
    * recovered with 1.17 and NOT recovered with 1.23.1
    * duplicate purchases are not possible with 1.17 but allowed with 1.23.1.
     
    Last edited: May 20, 2020
  40. vlater

    vlater

    Joined:
    Jun 4, 2013
    Posts:
    18
    I've done a little more testing and found out the following:

    I have 2 devices - one with demo UnityIAP version 1.17 (117) and one with version 1.23.1 (123)
    - After I purchase the product on device 117 it is not resolved on device 123
    - If I load the app on 123 - this make the products disappear on device 117 too - after play store data reset. So loading the app on 123 breaks the functionality on both 117 and 123
     
    Last edited: May 21, 2020
  41. vlater

    vlater

    Joined:
    Jun 4, 2013
    Posts:
    18
    - If I load the app on device 123 - it actually consumes the products??? I don't do anything just loading the app and in package capture I can see that there is "consumePurchase" call to google api which makes the products disappear from purchase list? Is this the desired behavior? This "consumePurchase" is not called from 117 device.

    So it seems that 1.23.1 make the products disappear by silently consuming them on load, without user doing anything. The products are visible at first, since they are stored locally, but after clearing the play store data - they can't be recovered anymore because they are consumed on load. Can this be fixed somehow?
     
    Last edited: May 21, 2020
  42. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    118
    That's really good info, @vlater! So it sounds like reverting to version 1.17 is a potential solution for now.

    I just got an email from Google Support today (ticket 9-1020000029660) that says they found that the IAP item was CONSUMED, even though it's marked as non-consumable in our IAP catalog and we never call that method ourselves. So that checks out with vlater's findings.

    @JeffDUnity3D Can you give us a timeline on when this will be fixed, or should we be fumbling around trying to work around the problem?
     
  43. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It's likely going to be several more weeks.
     
  44. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    118
    Fumbling around it is... :/
     
  45. pertz

    pertz

    Joined:
    Jan 8, 2015
    Posts:
    106
    Back in November/2019 we had already narrowed down the problem to Unity consuming incorrectly the purchases, and 6 months later they're still stalling us, while we get bad reviews and lose tens of thousands of dollars.

    What a great company Unity is. They dont even have the honor to CONFIRM the bug, say they screwed up, say how they will interact with Google on how to restore all the consumed purchases, what to do with customers who bought the same non-consumable multiple times due to this bug (will they get a refund? who will refund them, Unity?), how Unity will compensate the developers. They just STALL us for months and months. It's been OVER A YEAR this bug is affecting thousands of developers - only a handful found out this thread, but certainly everyone is being affected by this.

    Thanks @vlater and @MigrantP for narrowing it down even more with package capture (vlater) and Google Support (MigrantP). Now let's wait for another year for Unity to fix while dodging responsibility.
     
  46. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    118
    The theory that it only affects players with multiple devices seems to hold up for us - we only have reports of it on a game that's using Unity IAP and is on both tablets and phones; and all the reports are from users who use multiple devices. Our game that's only on tablets, and our other game that doesn't use Unity IAP have no reports of the problem.

    What we're doing for the moment is letting them know they should delete the game from all but one device, and only play it on that one device for now. We sent them promo codes for all the things they lost, and refunded any duplicate purchases they made.

    Not ideal at all, but it's a potential support strategy for now.
     
  47. Sailendu

    Sailendu

    Joined:
    Jul 23, 2009
    Posts:
    254
    I am also facing this issue, it's been more than a year, when will this issue be solved. Don't you think more than a year is too much time? Our users are reporting that the non consumable purchases are not working on 2nd device.
     
  48. MigrantP

    MigrantP

    Joined:
    Jun 24, 2013
    Posts:
    118
    I got another response from Google:

    After checking with our technical team, the in-app products are being consumed by the game and made sure that there's no issue from our side. In this case, I'll recommend you to contact Unity about the non-consumable setting.​

    So Unity, the ball is in your court. Please prioritize this issue!
     
    nemeth-regime and JeffDUnity3D like this.
  49. AakashDP

    AakashDP

    Joined:
    Nov 22, 2016
    Posts:
    21
    I'm facing the same issue with restoring non consumable purchases from Device A onto Device B on 1.23.1. As other have reported here, I downgraded to 1.18 as a test and although non consumable purchases weren't synced perfectly onto device B (not all purchases were synced), when trying to purchase a previously bought item again, there will be a popup from Google which says "You already own this item" which then informs my app that the purchase was completed.

    I can't stick with an older version of Unity IAP though, since I need to use some of the new api for subscription related features in other parts of my app which are only available in the newer version of the plugin.

    Any updates on this issue @JeffDUnity3D ?
     
  50. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    I'm trying to downgrade to 1.19, which includes subscription support, and seems to be prior to introduction of the bug they can't fix. It's passing our internal tests, but we haven't exposed it publicly yet. So not fully confident that the downgrade approach works yet.
     
    AakashDP likes this.
Thread Status:
Not open for further replies.