My app retrieve subscription status when the app starts
const customerInfo: CustomerInfo = await Purchases.getCustomerInfo(); console.log('current time', getDateTimeDisplayString(new Date().getTime())); console.log('customer info when loading the app', customerInfo);
however, it always loads the last cached data in my ios simulator
LOG current time 2024-04-22 19:35:32
LOG customer info when loading the app {"activeSubscriptions": s], "allExpirationDates": {}, "allExpirationDatesMillis": {}, "allPurchaseDates": {}, "allPurchaseDatesMillis": {}, "allPurchasedProductIdentifiers": s], "entitlements": {"active": {}, "all": {}, "verification": "NOT_REQUESTED"}, "firstSeen": "2024-04-22T23:30:56Z", "firstSeenMillis": 1713828656000, "latestExpirationDate": null, "latestExpirationDateMillis": null, "managementURL": null, "nonSubscriptionTransactions": s], "originalAppUserId": "56de1eda-4738-a098-55b8-041900dc5f37", "originalApplicationVersion": null, "originalPurchaseDate": null, "originalPurchaseDateMillis": null, "requestDate": "2024-04-22T23:32:07Z", "requestDateMillis": 1713828727000}
If I request the customer info later in the app. it returns the correct data.
LOG current time 2024-04-22 19:35:54
LOG customer info when requested later {"activeSubscriptions": c"rc_promo_Standard_daily"], "allExpirationDates": {"rc_promo_Standard_daily": "2024-04-23T23:32:40Z"}, "allExpirationDatesMillis": {"rc_promo_Standard_daily": 1713915160000}, "allPurchaseDates": {"rc_promo_Standard_daily": "2024-04-22T23:32:40Z"}, "allPurchaseDatesMillis": {"rc_promo_Standard_daily": 1713828760000}, "allPurchasedProductIdentifiers": e"rc_promo_Standard_daily"], "entitlements": {"active": {"Standard": "Object]}, "all": {"Standard": "Object]}, "verification": "NOT_REQUESTED"}, "firstSeen": "2024-04-22T23:30:56Z", "firstSeenMillis": 1713828656000, "latestExpirationDate": "2024-04-23T23:32:40Z", "latestExpirationDateMillis": 1713915160000, "managementURL": null, "nonSubscriptionTransactions": n], "originalAppUserId": "xxx", "originalApplicationVersion": null, "originalPurchaseDate": null, "originalPurchaseDateMillis": null, "requestDate": "2024-04-22T23:35:32Z", "requestDateMillis": 1713828932000}
Is there a way when app loads always request the latest server status? I saw other post saying I should wait a few seconds to request customer info, should I do that instead? Wondering how everyone handles it,
thanks,
Lin