Replies: 1 comment
-
|
Non-renewing subscriptions become inactive in StoreKit 2 after expiration, even if still within the subscription period. By default, Solutions1. Include inactive items (Recommended)const purchases = await getAvailablePurchases({
ios: {
onlyIncludeActiveItemsIOS: false,
},
});
// Manually check expiration
const active = purchases.filter(p =>
!p.expirationDateIOS || Date.now() < p.expirationDateIOS
);2. Query specific productimport {latestTransactionIOS} from 'react-native-iap';
const transaction = await latestTransactionIOS('your_subscription_id');
if (transaction?.expirationDateIOS) {
const isActive = Date.now() < transaction.expirationDateIOS;
}3. Check current entitlementimport {currentEntitlementIOS} from 'react-native-iap';
const entitlement = await currentEntitlementIOS('your_subscription_id');Why test accounts work differentlySandbox environments handle non-renewing subscription expiration differently than production, causing inconsistent behavior. Next StepsPlease confirm:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any reason why getAvailablePurchases would be returning no results even if a user has an active but non renewing subscription?
I was not able to reproduce the issue on a test account but a user reported this issue.
Beta Was this translation helpful? Give feedback.
All reactions