Skip to content
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

Fix breaking change in objc in 7.4.0 #572

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ - (void)testAPI {
dangerousSettings:nil
shouldShowInAppMessagesAutomatically:NO
verificationMode:@""];
RCPurchases *purchases2 __unused = [RCPurchases configureWithAPIKey:@""
appUserID:@""
observerMode:NO
userDefaultsSuiteName:nil
platformFlavor:nil
platformFlavorVersion:@""
usesStoreKit2IfAvailable:YES
dangerousSettings:nil
shouldShowInAppMessagesAutomatically:NO];
}

@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import RevenueCat
usesStoreKit2IfAvailable: Bool = false,
dangerousSettings: DangerousSettings?,
shouldShowInAppMessagesAutomatically: Bool = true,
verificationMode: String? = nil) -> Purchases {
verificationMode: String?) -> Purchases {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The compiler didn't complain 😕 but I think this is needed to disambiguate both configure methods.

var userDefaults: UserDefaults?
if let userDefaultsSuiteName = userDefaultsSuiteName {
userDefaults = UserDefaults(suiteName: userDefaultsSuiteName)
Expand Down Expand Up @@ -68,6 +68,29 @@ import RevenueCat
return purchases
}


@objc(configureWithAPIKey:appUserID:observerMode:userDefaultsSuiteName:platformFlavor:platformFlavorVersion:
usesStoreKit2IfAvailable:dangerousSettings:shouldShowInAppMessagesAutomatically:)
static func configure(apiKey: String,
appUserID: String?,
observerMode: Bool,
userDefaultsSuiteName: String?,
platformFlavor: String?,
platformFlavorVersion: String?,
usesStoreKit2IfAvailable: Bool = false,
dangerousSettings: DangerousSettings?,
shouldShowInAppMessagesAutomatically: Bool = true) -> Purchases {
return configure(apiKey: apiKey,
appUserID: appUserID,
observerMode: observerMode,
userDefaultsSuiteName: userDefaultsSuiteName,
platformFlavor: platformFlavor,
platformFlavorVersion: platformFlavorVersion,
usesStoreKit2IfAvailable: usesStoreKit2IfAvailable,
dangerousSettings: dangerousSettings,
shouldShowInAppMessagesAutomatically: shouldShowInAppMessagesAutomatically,
verificationMode: nil)
}
}

extension LogLevel {
Expand Down