Skip to main content
Answer

Best practice to check purchase of subscription or noneSubscription

  • November 3, 2025
  • 1 reply
  • 29 views

Forum|alt.badge.img

Hi I’d like to check whats the best practice / what are developers doing to figure out what people actually payed for after using the paywall.

I have two products users can choose from.

  • A one off payment to pay for “tokens” (Consumable) 
  • A monthly subscription

When a Customer pays for something, this triggers an event on  `addCustomerInfoUpdateListener`

 

To figure out If they subscribed I check ‘activeSubscriptions’ .. If a subscription is in the array then I know thats what they bought

 

 

But if they choose a consumable, im looking at  `nonSubscriptionTransactions` I can see a purchaseDate for each one. Do I look at the date to figure out if they just made the purchase? 

Whats best practice here?

 

Thanks

 

 

Best answer by guilherme

Hey ​@mrmack-a72a32,

The best way would be to capture the purchase result directly from your purchase call rather than trying to identify it in the listener. However, since you mentioned you're using a paywall, the approach depends on which paywall method you're using: 

If using the embedded paywall widgets (PaywallView or PaywallFooterView), use the onPurchaseCompleted callback:

PaywallView(
offering: offering,
onPurchaseCompleted: (CustomerInfo customerInfo, StoreTransaction storeTransaction) {
// storeTransaction tells you exactly what was purchased
String productId = storeTransaction.productIdentifier;

if (customerInfo.activeSubscriptions.isNotEmpty) {
// Handle subscription purchase
} else {
// Handle consumable token purchase
}
},
)

If using the modal paywall (RevenueCatUI.presentPaywall()), you won't have direct access to the transaction in the result. In that case, yes - comparing purchaseDate in your listener is valid. But the recommended approach would be indeed via the on complete listener.

The nonSubscriptionTransactions array is ordered by date ascending, so checking if the last item is newer than what you've seen before works fine.

/// Returns all the non-subscription purchases a user has made.

/// The purchases are ordered by purchase date in ascending order.

final List<StoreTransaction> nonSubscriptionTransactions;

More context here

This post has been closed for comments

1 reply

guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • Answer
  • November 6, 2025

Hey ​@mrmack-a72a32,

The best way would be to capture the purchase result directly from your purchase call rather than trying to identify it in the listener. However, since you mentioned you're using a paywall, the approach depends on which paywall method you're using: 

If using the embedded paywall widgets (PaywallView or PaywallFooterView), use the onPurchaseCompleted callback:

PaywallView(
offering: offering,
onPurchaseCompleted: (CustomerInfo customerInfo, StoreTransaction storeTransaction) {
// storeTransaction tells you exactly what was purchased
String productId = storeTransaction.productIdentifier;

if (customerInfo.activeSubscriptions.isNotEmpty) {
// Handle subscription purchase
} else {
// Handle consumable token purchase
}
},
)

If using the modal paywall (RevenueCatUI.presentPaywall()), you won't have direct access to the transaction in the result. In that case, yes - comparing purchaseDate in your listener is valid. But the recommended approach would be indeed via the on complete listener.

The nonSubscriptionTransactions array is ordered by date ascending, so checking if the last item is newer than what you've seen before works fine.

/// Returns all the non-subscription purchases a user has made.

/// The purchases are ordered by purchase date in ascending order.

final List<StoreTransaction> nonSubscriptionTransactions;

More context here