Skip to content

[in_app_purchase_storekit] Storekit2 RestorePurchase should give a single event. #187355

Closed
flutter/packages
#12237

Description

@robindijkhof

Use case

Right now with storekit2, every restored purchase is an event in purchaseStream So if I have 2 purchases, I get two events.

This is unexpected and a problem for multiple reasons.

  1. It is different from storekit1 and android behaviour. On both android and storekit1 a restore would come in as a single event with multiple purchases.
  2. There is no way knowing when all purchases are restored. You could take a guess with some sort of timeout, but there is no way to know for sure.
  3. There is no way knowing there is nothing to be restored. When there is nothing to restore there is no event.
  4. It is inefficient. There is no way combining purchase restores and sending a single request to your backend due to points 2 and 3 above. Therefore, each restore is a call to your backend. Each call is probably something like: update purchase -> fetch all purchases for user -> calculate and store grants.

Proposal

RestorePurchase should give a single event with multiple purchases. Or an empty list in case there are no purchases to restore.

Activity

  1. saurabh-mirajkar commented on Jun 2, 2026

    @saurabh-mirajkar
    Contributor

    @robindijkhof Thanks for the proposal. It appears to be related to #157558.

  2. added
    platform-iosiOS applications specifically
    platform-macosBuilding on or for macOS specifically
    packageflutter/packages repository. See also p: labels.
    c: proposalA detailed proposal for a change to Flutter
    fyi-ecosystemFor the attention of Ecosystem team
    team-iosOwned by iOS platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jun 2, 2026
  3. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Jun 4, 2026
  4. moved this from To triage to Moderate, low priority in Storekit 2 Tracker/[in_app_purchase_storekit] trackeron Jun 4, 2026
  5. moved this from Moderate, low priority to Good Test Candidates in Storekit 2 Tracker/[in_app_purchase_storekit] trackeron Jun 4, 2026
  6. self-assigned this
    on Jul 18, 2026
  7. github-actions commented on Aug 26, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  8. locked as resolved and limited conversation to collaborators on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: 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