Search Unity

Can't buy anything with UnityIAP on IOS (Thai region)

Discussion in 'Unity IAP' started by Playa_rc, Jun 11, 2019.

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

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    Hello. I have one problem. When I try to buy anything in my app using UnityIAP plugin on IOS (Thai region), I got an exception with strange stracktrace which is connected to DateTime methods.

    Exception:

    P.S. On other region (US, UK, EU) everything is okay and I can buy anything what I want.
    Unity 2018.3.14f1. In App Purchasing package version is 2.0.6. Apple (Sandbox). IAPSecurityException
     
    Last edited: Jun 11, 2019
  2. Playa_rc

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    Cannot validate due to unhandled exception. (System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Globalization.DateTimeFormatInfo.GetMonthName (System.Int32 month) [0x00000] in <00000000000000000000000000000000>:0 at System.Globalization.DateTimeFormatInfo.AddMonthNames (System.Globalization.TokenHashValue[] temp, System.String monthPostfix) [0x00000] in <00000000000000000000000000000000>:0 at System.Globalization.DateTimeFormatInfo.CreateTokenHashTable () [0x00000] in <00000000000000000000000000000000>:0 at System.Globalization.DateTimeFormatInfo.Tokenize (System.TokenType TokenMask, System.TokenType& tokenType, System.Int32& tokenValue, System.__DTString& str) [0x00000] in <00000000000000000000000000000000>:0 at System.WindowsConsoleDriver.IsModifierKey (System.Int16 virtualKeyCode) [0x00000] in <00000000000000000000000000000000>:0 at System.DateTimeParse.Lex (System.DateTimeParse+DS dps, System.__DTString& str, System.DateTimeToken& dtok, System.DateTimeRawInfo& raw, System.DateTimeResult& result, System.Globalization.DateTimeFormatInfo& dtfi, System.Globalization.DateTimeStyles styles) [0x00000] in <00000000000000000000000000000000>:0 at System.DateTimeParse.TryParse (System.String s, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles styles, System.DateTimeResult& result) [0x00000] in <00000000000000000000000000000000>:0 at System.DateTimeParse.Parse (System.String s, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles styles) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Security.AppleReceiptParser.ParseReceipt (LipingShare.LCLib.Asn1Processor.Asn1Node data) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Security.AppleReceiptParser.Parse (System.Byte[] receiptData, UnityEngine.Purchasing.Security.PKCS7& receipt) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Security.AppleValidator.Validate (System.Byte[] receiptData) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Security.CrossPlatformValidator.Validate (System.String unityIAPReceipt) [0x00000] in <00000000000000000000000000000000>:0 at InAppPurchases.PurchaseManager.ProcessPurchase (UnityEngine.Purchasing.PurchaseEventArgs args) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.PurchasingManager.ProcessPurchaseIfNew (UnityEngine.Purchasing.Product product) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.JSONStore.OnPurchaseSucceeded (System.String id, System.String receipt, System.String transactionID) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Extension.UnityUtil.Update () [0x00000] in <00000000000000000000000000000000>:0 ), e.StackTrace= at UnityEngine.Purchasing.Security.CrossPlatformValidator.Validate (System.String unityIAPReceipt) [0x00000] in <00000000000000000000000000000000>:0 at InAppPurchases.PurchaseManager.ProcessPurchase (UnityEngine.Purchasing.PurchaseEventArgs args) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.PurchasingManager.ProcessPurchaseIfNew (UnityEngine.Purchasing.Product product) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.JSONStore.OnPurchaseSucceeded (System.String id, System.String receipt, System.String transactionID) [0x00000] in <00000000000000000000000000000000>:0 at UnityEngine.Purchasing.Extension.UnityUtil.Update () [0x00000] in <00000000000000000000000000000000>:0
     
  3. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    What version of the IAP Asset package you you using? The latest is 1.22. You need both the Package Manager and Asset packages.
     
  4. Playa_rc

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    IAP Updates window says that I'm using the latest version (1.22.0)
    In App Purchasing in Package Manager version is 2.0.6
     
  5. BrianND

    BrianND

    Joined:
    May 14, 2015
    Posts:
    82
    I think this related to Unity fixing localisation in 2018.3. Now Datetime format uses Thai buddhist Calender on thai devices.
     
  6. Playa_rc

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    I have not found any info about it. Can you please provide any link?

    P.S. Or maybe unity representative can give some info?

    Have tried with 2018.4.2f1 and 2019.1.6f1 and got the same exception!
     
    Last edited: Jun 13, 2019
  7. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No updates at this time, this is an issue we are looking into.
     
  8. BrianND

    BrianND

    Joined:
    May 14, 2015
    Posts:
    82
  9. Playa_rc

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    Hello. Is there any update?
     
  10. Playa_rc

    Playa_rc

    Joined:
    Dec 10, 2013
    Posts:
    7
    Hello. More than two weeks has been passed! Is there any update?
     
    Last edited: Jul 1, 2019
  11. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    No updates, any fixes would expected to go into the next release, likely a few weeks to a few months out if it turns out to be addressable in the IAP package.
     
  12. LeeSunJin

    LeeSunJin

    Joined:
    Nov 29, 2018
    Posts:
    1
    Problem solved? We are having the same problem.
     
  13. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I have mentioned this again to the engineering team, hopefully bump up the priority.
     
  14. hippogames

    hippogames

    Joined:
    Feb 5, 2015
    Posts:
    233
    Hello! Got the same errors (SignatureInvalid) from Thai users! I'm using the latest IAP and Unity 2020. Unfortunately, I don't have a receipt to attach you.
     
  15. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I have ping'd engineering for an update.
     
  16. aubreypuan

    aubreypuan

    Joined:
    Mar 30, 2017
    Posts:
    9
    Dec 21, 2020 now, the issue still exist, mine is on android devices from Thailand, basically non consumable IAP purchases don't work because of date issues, but consumable ones works just fine.
     
  17. John_Corbett

    John_Corbett

    Joined:
    May 17, 2019
    Posts:
    151
    Hi @aubreypuan

    We have a fix that is undergoing code reviews and then QA validation. Unfortunately, due to the holiday season, most of our staff are on holiday, so it may take a while before it's release, but hopefully very early in January.

    We apologize for the inconvenience and will update you when it's released.
     
  18. nicholasr

    nicholasr

    Joined:
    Aug 15, 2015
    Posts:
    183
    Thank you for your patience as we investigated and identified the root cause - we found and fixed two issues with Thai locale flows in Unity IAP.

    Version 2.2.7 (not yet released) will completely fix this issue.

    The first fix in 2.2.6 addresses non-Subscription Products, and only partly addresses this issue.

    These fixes improves the stability of Unity IAP. Thank you very much for the clear reports.
     
  19. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    I just migrated to IAP 3.1.0 from 2.2.4 and I'm hearing that Thai subscriptions are no longer acknowledged on Android or iOS?
     
  20. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Where did you hear that, can you provide a link to the article or reference?
     
  21. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    Sorry for my choice of words, but I'm referring to my own feedback from Thai customers. Since upgrading from IAP 2.2.4 in Unity 2019.4 LTS to IAP 3.1.0 in Unity 2020.3 LTS, every Thai subscriber has complained that it is not restored (item.receipt is null). Bizarrely, they show up in Google Play as repeat orders that cost THB 0.00.

    I'm reluctant to blame the code as it's the same code that has worked all year, and no other region seems to be complaining of it. Any insight would be appreciated, as I don't know what to tell them!
     
  22. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    How are they restoring? I want to make sure they/we are using the correct terminology. Restore occurs when you reinstall the app, they should be receiving ProcessPurchase (and awarded the product) during IAP initialization. Is it only restore that is failing, but purchases are succeeding?
     
  23. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    Following the sample, I've been checking for valid receipts "OnInitialized". Thai receipts no longer get beyond "item.receipt!=null" where they used to and every other region does. It would help if I could get their item.metadata.isoCurrencyCode to treat them differently in the meantime?

    Even if they try to restore manually through RestoreTransactions() the purchase is not processed. I imagine new purchases are also not succeeding, but I have no evidence of that.
     
  24. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So receipts are null for Thai users, and non-null for other users? Are you able to get the isoCurrencyCode? Sorry I'm not quite following, that code looks correct. Is it generating an error? Restore is the automatic process (on Google) when users reinstall, please confirm. Your report claims that the initial purchase succeeds. But if they install the app on a second device or reinstall on this same device, then their products are not Restored.
     
  25. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    My understanding is that an initial purchase in IAP 2.2.4 was successful, but this can no longer be retrieved in IAP 3.1.0. Even more strangely, the attached is all from the same user who appears to "successfully" resubscribe for THB 0.00 every time they try to restore it.

    I'd like to revert back to v2.2.4, but I'm getting the impression this is discouraged in Unity 2020.3 LTS as it doesn't even show up as an option???
     

    Attached Files:

  26. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I might expect the image you provided, they are not being charged. Are you hearing this from just one user? Do you have the previous version APK or a previous release on the store you could publish or provide directly to the user? Yes, 2.2.4 does not appear to be available.
     
  27. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    After upgrading to @JeffDUnity3D unity version 2020.3.6 we are seeing that any DateTime.toString() crashes at
    System.Globalization.DateTimeFormatInfo.set_Calendar
    With "ArgumentOutOfRangeException: Not a valid calendar for the given culture. Parameter name: value"

    It's easily reproduce-able on Android device just by setting the language to Thai.
    I haven't been able to test IAPs but I'm assuming it is related...
     
  28. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry I don't quite follow, are you using IAP?
     
  29. eladleb4

    eladleb4

    Joined:
    Apr 25, 2016
    Posts:
    57
    We are using IAP but what I was sharing above was just my 2cents, as unity 2020.3.6 has a known issue with Thai locale (seems to be fixed with 2020.3.7)
     
  30. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Ah got it! Thanks for the heads up.
     
  31. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    My users have confirmed that changing their device's language to English does indeed fix their issue. I'm currently using 2020.3.1. Is it definitely fixed as of 2020.3.7?
     
  32. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    My Thai users still have an issue even after upgrading to Unity 2020.3.9 LTS with IAP 3.2.1. They can only proceed in the English language.
     
  33. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    So your users upgraded to the new version, have you confirmed?
     
  34. M_J_James

    M_J_James

    Joined:
    Jan 24, 2018
    Posts:
    11
    Yes, a handful of Thai users grabbed the very latest version and reported the same crash on Android (Unity 2020.3.9 LTS with IAP 3.2.1).
     
  35. Nuces

    Nuces

    Joined:
    Mar 24, 2014
    Posts:
    2
    This issue still exists in In App Purchasing 3.2.3 - Unity 2020.3.13f1+. It has cost us hundreds of man hours to debug and we have lost a lot of paid users because of this issue.
     
  36. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Hundreds of hours? Do you mean it works sometimes, and other times not? Otherwise it would be 5 minutes to test with the proper device, hundreds of man hours could purchase the equivalent of a few test devices! Regardless, we are investigating, it does not look specific to IAP but the system API calls we make, we are looking for a work around.
     
  37. lizhuangsanyigamestudio

    lizhuangsanyigamestudio

    Joined:
    Dec 2, 2021
    Posts:
    3
    I have the same problem,

    Using datetime.now.toString () will cause an error when the Android device selects Thai language
    Unity version: 2020.3.16
     
  38. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Are you using Unity IAP? What version?
     
  39. lizhuangsanyigamestudio

    lizhuangsanyigamestudio

    Joined:
    Dec 2, 2021
    Posts:
    3
    • No, it's just an empty project
     
  40. lizhuangsanyigamestudio

    lizhuangsanyigamestudio

    Joined:
    Dec 2, 2021
    Posts:
    3
    • I found a fix for this issue in Unity Version 2021,but there is no LTS version for 2021
     
  41. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, you are in the IAP forum, not related to your issue.
     
Thread Status:
Not open for further replies.