Users of our Android app are seeing incorrect subscription information. Using SDK version 4.3.0.
When debugging this issue we discovered that when calling Purchases.sharedInstance.getPurchaserInfoWith() the function sometimes returns incorrect data. It seems caching logic does not work correctly. For instance the function returns the PurchaseInfo object below when calling it now (nov 24th 20:53 GMT). The request date is 4 days off and there is no firstSeen date. We use these dates to verify trial status.
<PurchaserInfo
latestExpirationDate: null
activeSubscriptions: {},
activeEntitlements: [],
entitlements: [],
nonSubscriptionTransactions: [],
requestDate: Sat Nov 20 22:39:43 GMT+01:00 2021
>
When querying the API directly with a GET request from within Postman the result is:
{
"request_date": "2021-11-24T20:02:28Z",
"request_date_ms": 1637784148481,
"subscriber": {
"entitlements": {},
"first_seen": "2021-11-20T09:49:59Z",
"last_seen": "2021-11-24T19:31:41Z",
"management_url": null,
"non_subscriptions": {},
"original_app_user_id": "some user id",
"original_application_version": null,
"original_purchase_date": null,
"other_purchases": {},
"subscriptions": {}
}
So this is correct information.
Any idea how to fix this? If there a way to let the SDK not use the cache? Logcat in Android Studio shows it’s using the cache;
2021-11-24 20:37:58.944 12573-12573/? D/[Purchases] - DEBUG: Vending PurchaserInfo from cache.
2021-11-24 20:37:58.946 12573-12573/? D/[Purchases] - DEBUG: Checking if cache is stale AppInBackground true