Repository navigation
Description
Use case
When a user installs an app for the first time, they may be upgrading their phone or using a second device. Applications need to detect the current state of purchases (entitlements) so that the app can provide a seamless experience. For example, if a user is using a new device but has active subscriptions from another device, they should be able to use the app as if their subscription had always been active on the new device.
Best practice for iOS is captured in this WWDC video: https://developer.apple.com/videos/play/wwdc2022/110404/
In the video they describe using Transaction.currentEntitlements with StoreKit 2 to detect existing entitlements without the user having to login or interact with the UI in any way, and without network calls.
For older versions of iOS without StoreKit 2, they recommend using verifyReceipt which is an HTTP endpoint. This should not be called directly from the app, but could be called from an app-specific server. For this reason, verifyReceipt use is probably not feasible within the scope of the in_app_purchase library.
Using restoreTransactions is not recommended for this use case for two reasons:
- It creates a new transaction for every transaction previously completed
- It prompts the user to provide the user's App Store credentials, which interrupts the flow
Proposal
Provide API in in_app_purchase to access current entitlements using best practice described above with StoreKit 2 Transaction.currentEntitlements
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsModerate, High Priority
Activity
rokarnus commentedon Sep 19, 2025
At line 256 in the storekit 2 implementation the plugin seams to call Transaction.currentEntitlements. Does this mean that now inAppPurchase.purchaseStream (dart wrapper) will return actual valid subscriptions PurchaseStatus.restored like on Android? Or is this still returning all old subscriptions and renewals?
https://github.com/flutter/packages/blob/main/packages/in_app_purchase/in_app_purchase_storekit/darwin/in_app_purchase_storekit/Sources/in_app_purchase_storekit/StoreKit2/InAppPurchasePlugin%2BStoreKit2.swift
absar commentedon May 12, 2026
hi @LouiseHsu sorry for tagging you, but can this 3 year old issue be prioritized, without it there is no easy and efficient way to get only the
currentEntitlements. We need a list ofcurrentEntitlementsto decide which subscriptions are active. As a workaroundSK2Transaction.transactionscan be used but it is very inefficient and excessive, since it also returns Auto-renewable subscriptions, including all expired renewals, Unfinished consumables etcmaRci002 commentedon May 12, 2026
In StoreKit 2 there’s no longer a concept of a “restored” purchase.
Use either
AppStore.sync()- flutter packages linkOr
Transaction.currentEntitlements- flutter package link - it is therestorePurchasesbut again in SK2 there isn't any restore mechanismhandertool commentedon Oct 4, 2026
Hi @Hari-07, I'm interested in working on this and wanted to check with you before opening a PR. Are you actively working on it? If so, I'm happy to help test or review. If not, I'd like to pick it up.
[in_app_purchase_storekit] Add SK2Transaction.currentEntitlements() (#…