Skip to content

Conversation

@givip
Copy link
Contributor

@givip givip commented Jun 26, 2025

Added isEligibleForIntroOffer method support
https://developer.apple.com/documentation/storekit/product/subscriptioninfo/iseligibleforintrooffer

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@givip givip changed the title [in_app_purchase_storekit] isIntroductoryEligible implementation [in_app_purchase_storekit] isIntroductoryOfferEligible method implementation for StoreKit2 Jun 26, 2025
@givip givip changed the title [in_app_purchase_storekit] isIntroductoryOfferEligible method implementation for StoreKit2 [in_app_purchase_storekit] isIntroductoryOfferEligible implementation Jun 26, 2025
@givip givip requested a review from LongCatIsLooong July 2, 2025 05:09
isIntroductoryOfferEligibleChannel.setMessageHandler { message, reply in
let args = message as! [Any?]
let productIdArg = args[0] as! String
api.isIntroductoryOfferEligible(productId: productIdArg) { result in
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong Jul 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @LouiseHsu it looks like the extension where isIntroductoryOfferEligible is defined has this availability annotation:

Does this mean if the developer's app's target iOS version is < 15.0 they'll get a compile time error from the plugin code (even if they're not using these new APIs at all?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, availability annotation on extensions will compile fine on lower device version, it just cannot reference any code inside that extension!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah it looks like the InAppPurchase2API calls are all placed inside an available check:

if #available(iOS 15.0, macOS 12.0, *) {
    InAppPurchase2APISetup.setUp(binaryMessenger: messenger, api: instance)
}

So I guess if the application target's min iOS version is lower than 15 the caller would get a runtime error if they try to access methods defined in that extension, since the method channel is not set up?

@givip
Copy link
Contributor Author

givip commented Jul 7, 2025

@LouiseHsu could you check PR please?

Copy link
Contributor

@LouiseHsu LouiseHsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, sorry for the delay!

@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2025
@auto-submit auto-submit bot merged commit 2c52f24 into flutter:main Jul 7, 2025
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 7, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 7, 2025
flutter/packages@e4fd6c0...2c52f24

2025-07-07 pataridzegivi@gmail.com [in_app_purchase_storekit]
isIntroductoryOfferEligible implementation (flutter/packages#9499)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Jul 21, 2025
…#171705)

flutter/packages@e4fd6c0...2c52f24

2025-07-07 pataridzegivi@gmail.com [in_app_purchase_storekit]
isIntroductoryOfferEligible implementation (flutter/packages#9499)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
…#171705)

flutter/packages@e4fd6c0...2c52f24

2025-07-07 pataridzegivi@gmail.com [in_app_purchase_storekit]
isIntroductoryOfferEligible implementation (flutter/packages#9499)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
…flutter#9499)

Added `isEligibleForIntroOffer` method support
https://developer.apple.com/documentation/storekit/product/subscriptioninfo/iseligibleforintrooffer

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…#171705)

flutter/packages@e4fd6c0...2c52f24

2025-07-07 pataridzegivi@gmail.com [in_app_purchase_storekit]
isIntroductoryOfferEligible implementation (flutter/packages#9499)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: in_app_purchase platform-ios platform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants