Question

expirationDateMillis and originalAppUserId returned by Revenue Cat is wrong

  • 14 September 2023
  • 0 replies
  • 12 views

Badge

I am buying a subscription on a device connected to my computer. The expirationDateMillis returned by the SDK is wrong. It is the same date the subscription was done. According to the docs, shouldn't this be the date, when the subscription expires?


Looking at this

"originalPurchaseDate": "2023-05-08T13:11:37Z",
"expirationDate": "2023-09-13T07:00:58Z"
 

this is wrong. TheoriginalPurchaseDate should be Sep 13 2023 (when I subscribed) and theexpirationDate should be a month ahead in the future (thus Oct 13 2023). Additionally, originalAppUserId is "$RCAnonymousID:5933b0b7733a400fbc2f60b38733a23f" eventhough I do a await Purchases.logIn(userId);. I expect that to be my Apps user id?!

try {
await Purchases.logIn(userId);
const {customerInfo} = await Purchases.purchasePackage(pckage);
const activeEntitlementInfo =
customerInfo.entitlements.active[
REVENUE_CAT_SUBSCRIPTIONS_ENTITLEMENT_IDENTIFIER
];
if (typeof activeEntitlementInfo !== 'undefined') {
const {expirationDateMillis, productIdentifier, isActive} =
activeEntitlementInfo;
console.log(expirationDateMillis) // logs the date when the subscription was done

if (isActive) {
if (productIdentifier === PRODUCT_IDENTIFIER_SUBSCRIPTION_MONTHLY) {
...
}
if (productIdentifier === PRODUCT_IDENTIFIER_SUBSCRIPTION_YEARLY) {
...
}
} else {
...
}
}
} catch (e) {
if (!e.userCancelled) {
...
}
}
 

This is how activeEntitlementInfo looks like.

{
"allExpirationDates": {
"next_functionality": null,
"mapview_subscription_monthly": "2023-09-13T06:30:15Z",
},
"originalAppUserId": "$RCAnonymousID:5933b0b7733a400fbc2f60b38733a23f",
"originalPurchaseDate": "2013-08-01T07:00:00Z",
"nonSubscriptionTransactions": [
{
"purchaseDateMillis": 1694534062000,
"productId": "next_functionality",
"productIdentifier": "next_functionality",
"transactionIdentifier": "6d71fc2f78",
"purchaseDate": "2023-09-12T15:54:22Z",
"revenueCatId": "6d71fc2f78"
},
{
"productId": "next_functionality",
"transactionIdentifier": "e5217faf83",
"revenueCatId": "e5217faf83",
"purchaseDate": "2023-09-12T16:09:00Z",
"productIdentifier": "next_functionality",
"purchaseDateMillis": 1694534940000
},
{
"transactionIdentifier": "11b921a3cc",
"productIdentifier": "next_functionality",
"productId": "next_functionality",
"purchaseDateMillis": 1694574375000,
"purchaseDate": "2023-09-13T03:06:15Z",
"revenueCatId": "11b921a3cc"
}
],
"allPurchaseDates": {
"next_functionality": "2023-09-13T03:06:15Z",
"mapview_subscription_monthly": "2023-09-13T06:25:15Z",
},
"managementURL": "https://apps.apple.com/account/subscriptions",
"allPurchaseDatesMillis": {
"next_functionality": 1694574375000,
"mapview_subscription_monthly": 1694586315000,
},
"entitlements": {
"all": {
"Subscriber": {
"billingIssueDetectedAtMillis": null,
"expirationDateMillis": 1694586615000,
"expirationDate": "2023-09-13T06:30:15Z",
"unsubscribeDetectedAtMillis": null,
"billingIssueDetectedAt": null,
"originalPurchaseDateMillis": 1683551497000,
"latestPurchaseDateMillis": 1694586315000,
"isSandbox": true,
"productIdentifier": "mapview_subscription_monthly",
"periodType": "NORMAL",
"store": "APP_STORE",
"identifier": "Subscriber",
"isActive": true,
"unsubscribeDetectedAt": null,
"willRenew": true,
"ownershipType": "PURCHASED",
"latestPurchaseDate": "2023-09-13T06:25:15Z",
"originalPurchaseDate": "2023-05-08T13:11:37Z"
}
},
"active": {
"Subscriber": {
"originalPurchaseDate": "2023-05-08T13:11:37Z",
"latestPurchaseDate": "2023-09-13T06:25:15Z",
"expirationDate": "2023-09-13T06:30:15Z",
"expirationDateMillis": 1694586615000,
"billingIssueDetectedAt": null,
"unsubscribeDetectedAtMillis": null,
"identifier": "Subscriber",
"isActive": true,
"store": "APP_STORE",
"unsubscribeDetectedAt": null,
"periodType": "NORMAL",
"originalPurchaseDateMillis": 1683551497000,
"billingIssueDetectedAtMillis": null,
"ownershipType": "PURCHASED",
"willRenew": true,
"latestPurchaseDateMillis": 1694586315000,
"isSandbox": true,
"productIdentifier": "mapview_subscription_monthly"
}
}
},
"latestExpirationDate": "2023-09-13T06:30:15Z",
"allExpirationDatesMillis": {
"next_functionality": null,
},
"originalPurchaseDateMillis": 1375340400000,
"requestDateMillis": 1694586333317,
"activeSubscriptions": [
"mapview_subscription_monthly"
],
"originalApplicationVersion": "1.0",
"firstSeenMillis": 1694533273000,
"firstSeen": "2023-09-12T15:41:13Z",
"allPurchasedProductIdentifiers": [
"next_functionality",
"mapview_subscription_monthly"
],
"latestExpirationDateMillis": 1694586615000,
"requestDate": "2023-09-13T06:25:33Z"
}
 
  1. Environment
    1. Platform: iOS
    2. SDK version: "react-native-purchases": "^6.6.5",
    3. OS version: iOS 16.4
    4. Xcode/Android Studio version: XCode 14.3.1
    5. React Native version: "react-native": "0.71.7",
    6.  

Why is the expirationDateMillis wrong and why is it assigning not the Apps user id?


0 replies

Be the first to reply!

Reply