[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.Solved31Views0likes1CommentA refund REST API error has occurred.
All other Server APIs have been confirmed to be functioning properly. When checking the SKU via viewer_purchases, refund_iap_entitlement returns the "error_user_msg": "We can't find your order at this time." We are still in the development stage before the launch. Thank you. HTTP/1.1 400 Bad Request { "error": { "message": "An unknown error occurred", "type": "OAuthException", "code": 1, "error_subcode": 1891060, "is_transient": false, "error_user_title": "\uc8fc\ubb38\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4", "error_user_msg": "\ud604\uc7ac \ud68c\uc6d0\ub2d8\uc758 \uc8fc\ubb38\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.", "fbtrace_id": "APeiCD1VcJp0x3hE5hbRCev" } }21Views0likes0CommentsUnderstanding Server APIs for Subscription
Hello, I am testing 2 level subscription tier (both monthly) in draft mode and I am having trouble understanding certain behavior from server APIs responses during my testing with a test user account. 1. Subscription doesn't renew automatically GET https://graph.oculus.com/application/subscriptions Whenever I edit subscription end period from developer dashboard, the subscription remains in active state even after past the renewal date time, `period_start_time` and `period_end_time` has no change at all and `is_active` is also set to true. So my question is this expected that for test user the renewal is not automatic and I must "renew" manually from the dashboard? 2. Mismatch between APIs GET https://graph.oculus.com/application/subscriptions GET https://graph.oculus.com/$APP_ID/viewer_purchases The expiration time is 5 days in the future for /viewer_purchases as compared to /subscriptions which returns correct expiration time. There is another problem with /subscriptions api returns start and end period in datetime format instead of unix timestamp as in viewer_purchases endpoint. I also found that /viewer_purchases is less dependable as it continues to return the item even when subscription has been deleted from dashboard so /subscriptions appears to be more correct in this case. 3. Cancellation has no impact subscription status even after expiry GET https://graph.oculus.com/application/subscriptions Even after the expiration date has passed, the subscription returns `is_active` as true. so neither the subscription renews (when not cancelled) nor expires (when cancelled) from the dashboard. { "owner": { "id": "xxxxxxxxx" }, "sku": "example_pro_tier", "is_active": true, "period_start_time": "2025-09-20T08:20:52+0000", "period_end_time": "2025-10-20T08:20:52+0000", "next_renewal_time": "2025-10-20T08:20:52+0000", "cancellation_time": "2025-10-20T08:16:54+0000", "id": "xxxxxxxx" } } The only thing that works is if I manually "expire" from dashboard then the `is_active` is set to false 4. No Grace Period Data In the docs, its clearly written that subscription remains active for 3 more days if user renewal fails, however in test, there is no data related to grace period (for example: period_end_time and next_renewal_time should extended by the grace period). However, there is no way to test renew failure state -> enters into grace period state from dashboard. 5. Subscription ID remains unchanged GET https://graph.oculus.com/application/subscriptions Now this could be a feature that the Subscription ID remains same in case of upgrade, downgrade, renewals, cancellation, expiration, resubscription but this makes it harder to identify when user has actually renewed their subscription. For example, in my backend, I want to reward user some virtual items on each successful renewals, but if I depend on just SKU and expire timestamp then I would think user has renewed even in case user went into grace period and the expire timestamp has been extended (unless I am mistaken and expire timestamp doesn't extend in case of grace period). Now here is what I believe happens in production mode BUT I need to validate that my logic is not flawed at any point: 1. User subscribes to a low tier SKU (is_active is true) 2. User subscription renews: i. Success - period_end_time is extended to next date in future. ii. Failure - user enter grace period and ONLY next_renewal_time is extened while is_active still remain true a. Renewal success after grace period ends - period_end_time is extended and is_active still remain true b. Renewal fails again after grace period ends OR if user cancels subscription while in grace period - then is_active is set to false 3. User decides to upgrade to higher tier SKU (sku, period_end_time is updated and is_active is set to true) 4. User decides to downgrade to lower tier SKU (no changes until renewal at which point lower tier will be activated (sku, period_end_time will be updated and is_active will remain set to true)) 5. User cancels the subscription while in subscription (cancellation_time will be available but no action needed as user can continue to use remaining period left into their subscription cycle) 6. Subscription expires post expiration date after being cancelled (is_active is set to false) 7. User returns again (is_active is true and period_end_time is updated) Let me know if I missed something here and if I can use this logic to basically depend on sku, is_active and period_end_time changes to notify my backend to reward user indicating there was a successful purchase, renewal or upgrades.18Views0likes0Comments[IAP] Each Purchase object has its "Type" property set to Unknown for subscriptions.
Full Disclosure: I am testing subscriptions in draft mode and with test user account. IAP.GetViewerPurchases().OnComplete(msg => { if (msg.IsError) { return; } if (msg.GetPurchaseList().Count == 0) { return; } foreach (Purchase item in msg.GetPurchaseList()) { Debug.LogFormat("Purchased: sku:{0} granttime:{1} id:{2} expire:{3} type:{4}", item.Sku, item.GrantTime, item.ID, item.ExpirationTime, item.Type); // All values are available properly except for item.Type prints "unknown" in console. } }); However, this API does return any unconsumed items properly with type set to "CONSUMABLE" but for subscription its not working. So my question is, if this is happening due to subscription being in draft mode? and if I can depend on this property in production app to check if items in loop is any unconsumed product or just a subscription ?56Views1like3Comments"Age restriction" in Add-ons testing
Hello! I'm developing a game for the Meta Store in Unity3D. I'm currently implementing and testing Addons (in-app purchases). Following the instructions at https://developers.meta.com/horizon/documentation/unity/ps-iap, I created IAP items (with prices and descriptions), created a test user, added them to the development team, and logged in as this test user to the mobile app and on the Meta Quest 2 device. However, when I try to purchase an item using the LaunchCheckoutFlow method on the device, a window appears with the message, "Request Failed. This purchase isn't available in the app due to age restrictions." What's the problem? Best regards, Andrey Klenin30Views0likes1Comment