Skip to content

[in_app_purchase_storekit] isIntroductoryOfferEligible implementation - #9499

Merged
auto-submit[bot] merged 17 commits into
flutter:mainfrom
givip:feature_isIntroductoryEligible
Jul 7, 2025
Merged

[in_app_purchase_storekit] isIntroductoryOfferEligible implementation#9499
auto-submit[bot] merged 17 commits into
flutter:mainfrom
givip:feature_isIntroductoryEligible

Conversation

@givip

@givipgivip commented Jun 26, 2025

Copy link
Copy Markdown
Contributor

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. 23

@givipgivip changed the title [in_app_purchase_storekit] isIntroductoryEligible implementation[in_app_purchase_storekit] isIntroductoryOfferEligible method implementation for StoreKit2Jun 26, 2025
@givipgivip changed the title [in_app_purchase_storekit] isIntroductoryOfferEligible method implementation for StoreKit2[in_app_purchase_storekit] isIntroductoryOfferEligible implementationJun 26, 2025
isIntroductoryOfferEligibleChannel.setMessageHandler { message, reply in
let args = message as! [Any?]
let productIdArg = args[0] as! String
api.isIntroductoryOfferEligible(productId: productIdArg) { result in

@LongCatIsLooongLongCatIsLooongJul 2, 2025

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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

givip commented Jul 7, 2025

Copy link
Copy Markdown
ContributorAuthor

@LouiseHsu could you check PR please?

@LouiseHsuLouiseHsu left a comment

Copy link
Copy Markdown
Contributor

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!

@LouiseHsuLouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 7, 2025
@auto-submit
auto-submitBot merged commit 2c52f24 into flutter:mainJul 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 7, 2025
github-merge-queueBot 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
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
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
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
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
…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.
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
…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.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmitMerge PR when tree becomes green via auto submit Appp: in_app_purchaseplatform-iosplatform-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@givip@LongCatIsLooong@LouiseHsu