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

[Solved] InitiatePurchase with developerPayload on IAP 1.17.0

Discussion in 'Unity IAP' started by russiac80, Mar 28, 2018.

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

    russiac80

    Joined:
    Feb 23, 2018
    Posts:
    2
    unity version : 2017.2.1p2
    IAP version : 1.17.0 ( but 1.15.0 work fine!!! )
    test device : Galaxy S8(Android 7.0)

    long payload = 1455;
    storeController.InitiatePurchase(p, payload.ToString());


    -error log-


    Unity : UnityIAP: JSONStore exception handling developerPayload: System.InvalidCastException: Unable to cast object of type 'Int64' to type 'Dictionary`2'.
    Unity : at UnityEngine.Purchasing.JSONStore
    .Purchase (UnityEngine.Purchasing.ProductDefinition product, System.String developerPayload) [0x00000] in <filename unknown>:0
    Unity : at UnityEngine.Purchasing.PurchasingManager.InitiatePurchase (UnityEngine.Purchasing.Product product, System.String developerPayload) [0x00000] in <filename unknown>:0
     
    Last edited: Mar 28, 2018
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Is this a runtime error that you are seeing? I will investigate, it sounds like you've confirmed that it worked correctly with 1.15 but with no other changes, fails with 1.17
     
  3. russiac80

    russiac80

    Joined:
    Feb 23, 2018
    Posts:
    2
    Yes. In runtime it will work fine in version 1.15.0, but in version 1.17.0 it will cause the above error.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    It turns out that this is a warning only, and should not cause issue and should only showing as this log entry. Can you confirm that it isn't affecting your purchase flow? The warning is incorrect however, and the IAP team has been made aware.
     
  5. dfurmanGS

    dfurmanGS

    Joined:
    Jun 29, 2017
    Posts:
    11
    Come on guys!!... For you it's a "warning" for us is a spam in error log... It's impossible that you didn't see that if you been testing it. Guys, this exception is thrown with each payment initialization! What the f... We are not your QA's...
     
Thread Status:
Not open for further replies.