Skip to content

[in_app_purchase] support current entitlements on iOS #118960

Open

Description

@greensopinion

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:

  1. It creates a new transaction for every transaction previously completed
  2. 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

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    platform-iosiOS applications specifically
    c: proposalA detailed proposal for a change to Flutter
    platform-macosBuilding on or for macOS specifically
    and removed
    in triagePresently being triaged by the triage team
    on Jan 23, 2023
  2. added
    P3Issues that are less important to the Flutter project
    on Jan 26, 2023
  3. rokarnus commented on Sep 19, 2025

    @rokarnus

    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

  4. moved this from To triage to Moderate, High Priority in Storekit 2 Tracker/[in_app_purchase_storekit] trackeron Dec 16, 2025
  5. absar commented on May 12, 2026

    @absar

    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 of currentEntitlements to decide which subscriptions are active. As a workaround SK2Transaction.transactions can be used but it is very inefficient and excessive, since it also returns Auto-renewable subscriptions, including all expired renewals, Unfinished consumables etc

  6. maRci002 commented on May 12, 2026

    @maRci002
    Contributor

    In StoreKit 2 there’s no longer a concept of a “restored” purchase.

    Use either AppStore.sync() - flutter packages link
    Or Transaction.currentEntitlements - flutter package link - it is the restorePurchases but again in SK2 there isn't any restore mechanism

  7. self-assigned this
    on Jul 18, 2026
  8. handertool commented on Oct 4, 2026

    @handertool

    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.

  9. removed their assignment
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: in_app_purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyplatform-macosBuilding on or for macOS specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions