-
Notifications
You must be signed in to change notification settings - Fork 316
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
[ RevenueCatUI ] - Custom Loading View for PaywallView and PaywallFooter #3216
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Thanks for the request! As you mentioned, struct ContentView: View {
@State
private var displayPaywall: Bool = true
var body: some View {
ContentView()
.sheet(isPresented: self.$displayPaywall) {
LoadingPaywallView()
}
}
}
struct LoadingPaywallView: View {
@State
private var offering: Offering?
var body: some View {
Group {
if let offering {
// This will now be guaranteed to display without any loading delays
PaywallView(offering: offering)
} else {
// You can show whatever you want here
Text("Loading...")
}
}
.task {
// You'll need to do error handling too
self.offering = try? await Purchases.shared.offerings().current
}
}
} The same is true when using Let us know if this solves your particular issue or if we can help with anything else! |
@NachoSoto I'm sorry if I wasn't clear, but the problem is not in loading the offer, I already do. The issue is during the use of the Paywall provided by RevenueCatUI, it generates some inconsistencies I recorded a video to facilitate the explanation. See that right after your answer I will delete the links to avoid exposing my application. Video 1 - During the delay between displaying the Apple Store purchase popup, PaywallView does not have an interesting feedback screen for the user: The ideal would be: Video 2 - While the user waits for the purchase to be confirmed there is no "blocking" and he can continue browsing. These two situations could be easily solved, with the implementation of the extension above where I could provide the blocking of the shet and a custom loading screen as I showed in the "ideal". |
Thanks for the videos! Turns out that we lost the loading state for the purchase button, so I restored it: #3217 |
Thank you for your beautiful work, this package is an evolution for RevenueCat, it will help a lot in a bottleneck that exists in the development of apps/paywalls. I'm going to remove the links... |
Fixes #3216. This likely got broken with #3121 because we stopped using `.buttonStyle`. This implements a manual style when the button is `disabled` (when `PurchaseHandler.actionInProgress` is `true`). https://github.com/RevenueCat/purchases-ios/assets/685609/0e23bcf1-7e1d-4d57-adf7-61a76b1e997e
This issue has been automatically locked due to no recent activity after it was closed. Please open a new issue for related reports. |
The solution
Create an extension view similar to `onPurchaseCompleted/onRestoreCompleted´ that returns Bool to control the display of a Custom Loading View.
I have a custom loading throughout my application, but in RevenueCatUI I lose this UI consistency, because I did not find an "uncomplicated" way to do this simple action and receive the status of actionInBlock.
In my specific case I have an extension for the View called `.loading´ that receives a bool parameter with this implementation I could easily add my custom loading.
Por ex:
A positive point for this approach also works for `paywallFooter´ and taking complexity and adding customization to each project.
Already taking the opportunity to say that a `onUserCancel´ is also positive so that you can have the opportunity to track the event and also display an offer to the user, an opportunity in view of the fact that many checkouts are started and canceled.
Environment
usesStoreKit2IfAvailable(true)
)Debug logs that reproduce the issue. Complete logs with
Purchases.logLevel = .verbose
will help us debug this issue.Steps to reproduce, with a description of expected vs. actual behavior
Not necessary.
Another context that creates an inconsistency is when the paywall is displayed via shet where the user can close even after clicking buy due to the delay of the apple popup.
It can be corrected with the developer obtaining the status and blocking the closure of the shet
The text was updated successfully, but these errors were encountered: