Forum Discussion

to_the_cosmic_end's avatar
12 days ago
Solved

[Unity] IAP.GetViewerPurchases() returns Platform error

Hello, I am facing a weird issue with my IAP in my testing account where every time, I try to fetch user purchases:

IAP.GetViewerPurchases().OnComplete(msg =>
{
    if (msg.IsError)
    {
        Debug.Log($"Error: {msg.GetError().Message}"); //lands here every time
        return;
    }
//other code
}

and this is error message:

OVRPlatform [Purchase] Purchase::deserialize: response object field "grant_time" was not a uint64. Value is: -120

and my log message:

Error: Server response is not valid JSON.

This started happening after my test subscription expired and I deleted the subscription from my dashboard.

 

-- UPDATE --
Same issue with `IAP.GetViewerPurchasesDurableCache()`

-- UPDATE 2 --
Looks like this problem is occurring with `IAP.LaunchCheckoutFlow` as well. In my opinion, this is likely a test account only issue but there is no way to confirm.

  • So I ended up creating a new test user and rightfully, the new test user was able to take all IAP related actions that is until it subscribed and then deleted the subscription from the dashboard. Here is the solution that I found: Don't "Delete" subscription from the dashboard as that seems to trigger this error. The correct way is to first "Cancel" and then "Expire" from the dashboard. 

    If for someone, this error is still occurring even after setting it to "Expired" state, then go to Development -> Test Users -> triple dot of your test user account -> Manage test credit cards -> switch to a different card as default . That seems to reset any subscription state for that test user and you can start fresh.

    Crazy stuff!

1 Reply

  • So I ended up creating a new test user and rightfully, the new test user was able to take all IAP related actions that is until it subscribed and then deleted the subscription from the dashboard. Here is the solution that I found: Don't "Delete" subscription from the dashboard as that seems to trigger this error. The correct way is to first "Cancel" and then "Expire" from the dashboard. 

    If for someone, this error is still occurring even after setting it to "Expired" state, then go to Development -> Test Users -> triple dot of your test user account -> Manage test credit cards -> switch to a different card as default . That seems to reset any subscription state for that test user and you can start fresh.

    Crazy stuff!

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions