Question Details

No question body available.

Tags

ios flutter in-app-purchase

Answers (1)

August 18, 2025 Score: 2 Rep: 106 Quality: Low Completeness: 80%

When struggling with App Store payments I always find the Revenue Cat documentation a great go-to resource - https://www.revenuecat.com/docs/test-and-launch/sandbox/apple-app-store#:~:text=Sandbox%20Considerations%E2%80%8B&text=In%20sandbox%2C%20StoreKit%20Test%2C%20and,regions%20set%20for%20devices/accounts.

If it's possible with your codebase you could possibly treat these similarly anyway if the ongoing flow is similar

// Treat both statuses similarly for subscriptions
if (purchaseDetails.status == PurchaseStatus.purchased ||
    purchaseDetails.status == PurchaseStatus.restored) {
  // For subscriptions, both indicate valid ownership
  if (purchaseDetails.productID == 'yoursubscriptionid') {
    // Grant access regardless of status
    await grantSubscriptionAccess(purchaseDetails);
  }
}

And instead of relying solely on the status, verify the purchase receipt:

// Check the transaction date to determine if it's truly new
if (purchaseDetails.transactionDate != null) {
  final isNewPurchase = DateTime.now()
      .difference(DateTime.fromMillisecondsSinceEpoch(
          int.parse(purchaseDetails.transactionDate!)))
      .inMinutes < 5; // Within last 5 minutes

if (isNewPurchase) { // Treat as new purchase regardless of status } }