-
Notifications
You must be signed in to change notification settings - Fork 432
Add checkTrialOrIntroDiscountEligibility(package: Package) #7159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
1eced82
b2e9c2c
76c68c1
893f6e0
c219432
14de402
fa9a9d5
1db4d10
e4255d5
68c75d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -723,6 +723,58 @@ public protocol PurchasesType: AnyObject { | |||||
| func checkTrialOrIntroDiscountEligibility(product: StoreProduct) async | ||||||
| -> IntroEligibilityStatus | ||||||
|
|
||||||
| /** | ||||||
| * Computes whether or not a user is eligible for the introductory pricing period of a given package. | ||||||
| * You should use this method to determine whether or not you show the user the normal product price or | ||||||
| * the introductory price. This also applies to trials (trials are considered a type of introductory pricing). | ||||||
| * [iOS Introductory Offers](https://docs.revenuecat.com/docs/ios-subscription-offers). | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * | ||||||
| * - Note: If you're looking to use Promotional Offers instead, | ||||||
| * use ``Purchases/getPromotionalOffer(forProductDiscount:product:completion:)``. | ||||||
| * | ||||||
| * - Note: Subscription groups are automatically collected for determining eligibility. If RevenueCat can't | ||||||
| * definitively compute the eligibility, most likely because of missing group information, it will return | ||||||
| * ``IntroEligibilityStatus/unknown``. The best course of action on unknown status is to display the non-intro | ||||||
| * pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest | ||||||
| * version of iOS so that the subscription group can be collected by the SDK. | ||||||
| * | ||||||
| * - Parameter package: The ``Package`` for which you want to compute eligibility. | ||||||
| * - Parameter completion: A block that receives an ``IntroEligibilityStatus``. | ||||||
| * | ||||||
| * ### Related symbols | ||||||
| * - ``Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:completion:)`` | ||||||
| * - ``Purchases/checkTrialOrIntroDiscountEligibility(product:completion:)`` | ||||||
| */ | ||||||
|
Comment on lines
+744
to
+747
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to my previous point, in "Related symbols" we could add the |
||||||
| @objc(checkTrialOrIntroDiscountEligibilityForPackage:completion:) | ||||||
| func checkTrialOrIntroDiscountEligibility( | ||||||
| package: Package, | ||||||
| completion: @escaping (IntroEligibilityStatus) -> Void | ||||||
| ) | ||||||
|
|
||||||
| /** | ||||||
| * Computes whether or not a user is eligible for the introductory pricing period of a given package. | ||||||
| * You should use this method to determine whether or not you show the user the normal product price or | ||||||
| * the introductory price. This also applies to trials (trials are considered a type of introductory pricing). | ||||||
| * [iOS Introductory Offers](https://docs.revenuecat.com/docs/ios-subscription-offers). | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| * | ||||||
| * - Note: If you're looking to use Promotional Offers instead, | ||||||
| * use ``Purchases/getPromotionalOffer(forProductDiscount:product:completion:)``. | ||||||
| * | ||||||
| * - Note: Subscription groups are automatically collected for determining eligibility. If RevenueCat can't | ||||||
| * definitively compute the eligibility, most likely because of missing group information, it will return | ||||||
| * ``IntroEligibilityStatus/unknown``. The best course of action on unknown status is to display the non-intro | ||||||
| * pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest | ||||||
| * version of iOS so that the subscription group can be collected by the SDK. | ||||||
| * | ||||||
| * - Parameter package: The ``Package`` for which you want to compute eligibility. | ||||||
| * | ||||||
| * ### Related symbols | ||||||
| * - ``Purchases/checkTrialOrIntroDiscountEligibility(productIdentifiers:)`` | ||||||
| * - ``Purchases/checkTrialOrIntroDiscountEligibility(product:)`` | ||||||
| */ | ||||||
| func checkTrialOrIntroDiscountEligibility(package: Package) async | ||||||
| -> IntroEligibilityStatus | ||||||
|
|
||||||
| /** | ||||||
| * Use this method to fetch ``PromotionalOffer`` | ||||||
| * to use in ``Purchases/purchase(package:promotionalOffer:)`` | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not for this PR, but now that we're adding the singular
package:overload toPurchasesType, I realized that the pluralcheckTrialOrIntroDiscountEligibility(packages:)still lives only on the concretePurchasesclass and not in the protocol. I don't think there's a reason for that? Might be worth a follow-up to add it here for consistency (I'd be fine with sneaking it in with this PR though).