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

Paywalls: updated Integration Test snapshot #2921

Merged
merged 3 commits into from
Jul 31, 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
23 changes: 14 additions & 9 deletions Sources/Purchasing/Purchases/Purchases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1611,19 +1611,24 @@ private extension Purchases {
self.offeringsManager.updateOfferingsCache(appUserID: self.appUserID,
isAppBackgrounded: isAppBackgrounded) { offerings in
if let offering = offerings.value?.current, let paywall = offering.paywall {
let packageTypes = Set(paywall.config.packages)
let products: [String] = offering.availablePackages
.lazy
.filter { packageTypes.contains($0.packageType) }
.map(\.storeProduct.productIdentifier)

Logger.debug(Strings.eligibility.warming_up_eligibility_cache(paywall))

self.trialOrIntroPriceEligibilityChecker.checkEligibility(productIdentifiers: products) { _ in }
self.operationDispatcher.dispatchOnWorkerThread {
self.warmUpEligibilityCache(offering: offering, paywall: paywall)
}
}
}
}

private func warmUpEligibilityCache(offering: RCOffering, paywall: PaywallData) {
let packageTypes = Set(paywall.config.packages)
let products: [String] = offering.availablePackages
.lazy
.filter { packageTypes.contains($0.packageType) }
.map(\.storeProduct.productIdentifier)

Logger.debug(Strings.eligibility.warming_up_eligibility_cache(paywall))
self.trialOrIntroPriceEligibilityChecker.checkEligibility(productIdentifiers: products) { _ in }
}

}

// MARK: - Deprecations
Expand Down
1 change: 1 addition & 0 deletions Sources/Support/FrameworkDisambiguation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@

typealias RCRefundRequestStatus = RefundRequestStatus
typealias RCErrorCode = ErrorCode
typealias RCOffering = Offering
let RCDefaultLogHandler = defaultLogHandler
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,50 @@
"platform_product_identifier" : "com.revenuecat.weekly_1.99.3_day_intro"
}
],
"paywall" : null
"paywall" : {
"asset_base_url" : "https://d35rwhxn1vk1te.cloudfront.net",
"config" : {
"blurred_background_image" : true,
"colors" : {
"light" : {
"accent1" : "#ec64e5",
"accent2" : "#d9d9d9",
"background" : "#ffffff",
"call_to_action_background" : "#45c186",
"call_to_action_foreground" : "#ffffff",
"text1" : "#000000"
}
},
"default_package" : "$rc_monthly",
"display_restore_purchases" : true,
"images" : {
"background" : "300883_1690710097.jpg",
"icon" : "300883_1690710150.jpg"
},
"packages" : [
"$rc_monthly",
"$rc_annual"
],
"privacy_url" : "https://revenuecat.com/privacy",
"tos_url" : "https://revenuecat.com/tos"
},
"default_locale" : "en_US",
"localized_strings" : {
"en_US" : {
"call_to_action" : "Purchase for {{ price_per_month }} per month",
"call_to_action_with_intro_offer" : "Start your {{ intro_duration }} trial, then {{ price_per_month }} per month",
"features" : [

],
"offer_details" : "{{ total_price_and_per_month }}",
"offer_details_with_intro_offer" : "{{ total_price_and_per_month }} after {{ intro_duration }} trial",
"offer_name" : "{{ period }}",
"subtitle" : "Gert access to all our educational content trusted by thousands of parents",
"title" : "Ignite your child's curiosity"
}
},
"template_name" : "multi_package_bold"
}
},
{
"description" : "Coins",
Expand Down