Skip to content

Conversation

@fire-at-will
Copy link
Contributor

Context

In release 5.23.0, we unintentionally broke the public API for the Offering and Package initializers by adding a non-optional webCheckoutUrl: URL? parameter.

The breaking changes were introduced in the these PRs/commits:

Description

This PR restores the previous API by re-introducing new public initializers for these structs that omit the webCheckoutUrl parameter, matching the API contracts prior to 5.23.0. It also adds these re-introduced constructors to the API testers.

This PR introduces entirely new convenience initializers rather than adding a default value of nil to the existing ones, because initializers with default parameter values aren’t exposed to Objective-C. Simply adding a default would not restore the original Objective-C API.

@fire-at-will fire-at-will added the pr:fix A bug fix label Aug 13, 2025
@fire-at-will fire-at-will requested a review from a team August 13, 2025 15:58
@fire-at-will fire-at-will marked this pull request as ready for review August 13, 2025 15:58
@fire-at-will fire-at-will changed the title Bring Back Old Package & Offering Constructor APIs Restore Old Package & Offering Constructor APIs Aug 13, 2025
@fire-at-will fire-at-will changed the title Restore Old Package & Offering Constructor APIs Restore Old Package & Offering Initializer APIs Aug 13, 2025
@emerge-tools
Copy link

emerge-tools bot commented Aug 13, 2025

📸 Snapshot Test

1 modified, 704 unchanged

Name Added Removed Modified Renamed Unchanged Errored Approval
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-optimized-for-mac
0 0 0 0 235 0 N/A
RevenueCat
com.revenuecat.PaywallsTester.mac-catalyst-scaled-to-match-ipad
0 0 1 0 234 0 ✅ Approved
RevenueCat
com.revenuecat.PaywallsTester
0 0 0 0 235 0 N/A

🛸 Powered by Emerge Tools

@fire-at-will
Copy link
Contributor Author

@RCGitBot please test

Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

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

This looks good! Just a couple of non-blocker comments.


/// Initialize an ``Offering`` given a list of ``Package``s.
@objc
public convenience init(
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder, should we deprecate these constructors? Not sure if we want to push devs into just a single constructor... Maybe we should even try to make the "main" constructor internal to avoid these issues but we would need to keep the current ones public for backwards compatibility

Copy link
Contributor

@JZDesign JZDesign left a comment

Choose a reason for hiding this comment

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

Thanks!

closes #5460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants