Skip to content

[in_app_purchase_storekit] Expose StoreKit 2 introductoryOfferEligibility(compactJWS:) purchase option #191668

Closed
flutter/packages
#12584

Description

@joelbg-cloud

Use case

StoreKit 2 lets a server decide, per purchase, whether an introductory offer applies, via Product.PurchaseOption.introductoryOfferEligibility(compactJWS:).

The app receives a compact JWS that its own server signs with an App Store Connect In-App Purchase key (see Generating JWS to sign App Store requests) and passes it to StoreKit as a purchase option. The JWS carries an allowIntroductoryOffer claim which Apple documents as "a Boolean value, true or false, that determines whether the customer is eligible for an introductory offer".

This is useful for any app whose introductory-offer eligibility rules live on its own server rather than being inferred from App Store purchase history — for example when eligibility depends on server-side account state, or when an offer should only be available during a server-determined window.

in_app_purchase_storekit does not currently expose this purchase option, so apps that need it cannot use the plugin's purchase path.

Note this is distinct from the existing isIntroductoryOfferEligible(productId), which wraps Product.SubscriptionInfo.isEligibleForIntroOffer and reads the App Store's default eligibility. That read cannot express a server-signed per-purchase decision, and cannot override the default in either direction.

The API is available on iOS 15.0+ / macOS 12.0+ (declared @backDeployed(before: iOS 18.4, macOS 15.4, ...)), which matches the existing availability floor of the plugin's StoreKit 2 code, so no additional OS version gate is required.

Proposal

Add an optional StoreKit 2-specific field to Sk2PurchaseParam:

Sk2PurchaseParam(
  productDetails: productDetails,
  introductoryOfferEligibilityCompactJWS: compactJWSFromMyServer,
);

forwarded unchanged to Product.PurchaseOption.introductoryOfferEligibility(compactJWS:).

The plugin would treat the JWS as opaque data: never generating, signing, parsing, validating or inspecting it.

Compatibility:

  • optional and null by default
  • when null, no purchase option is added and the App Store applies its own default eligibility, so existing apps are unaffected
  • StoreKit 2 only; no StoreKit 1 behavior change

Activity

  1. added
    in triagePresently being triaged by the triage team
    packageflutter/packages repository. See also p: labels.
    fyi-ecosystemFor the attention of Ecosystem team
    team-iosOwned by iOS platform team
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Aug 25, 2026
  2. added
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Aug 27, 2026
  3. added a commit that references this issue on Sep 3, 2026
    6375840
  4. added a commit that references this issue on Sep 4, 2026
    334faff
  5. added 2 commits that reference this issue on Sep 9, 2026
    96f0bf6
    83c9efe
  6. github-actions commented on Sep 18, 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.

  7. locked as resolved and limited conversation to collaborators on Sep 18, 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

    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.team-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions