Paywalls: Auto-close paywall activity if restore grants required entitlement identifier#1507
Conversation
| finish() | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
hmmm this is making me think... if anyone is already doing this (finishing the activity when they get a PaywallResult.Restored, this will break their implementation. Right? Are we doing this in iOS?
There was a problem hiding this comment.
PaywallResult.Restored is a new sealed class element. Until now, I don't think users could detect whether the activity had restored or not.
As for iOS. I do think we have a didFinishRestoringWith delegate developers can use for this but I don't think it autocloses. That's something developers would need to handle themselves.
There was a problem hiding this comment.
😮💨 ok, should have kept reading
sorry for the noise
There was a problem hiding this comment.
I think we can autoclose and if anyone complains, we can add a setting somehow. I think autoclosing is a better default experience
There was a problem hiding this comment.
Well, in iOS I think we are not autoclosing for now. Not on a normal purchase nor on a restore. We talked about this before, and we felt it was more in line with iOS to not autodismiss. CC @aboedo @NachoSoto for confirmation.
But in android, since the developer doesn't have good access to the paywall activity, nor a way to commuinicate with it once the paywall activity is launched, we need to handle it for them.
There was a problem hiding this comment.
Right, there's no way for them to access the activity that was just launched. So even if they wanted to close it themselves, they can't
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1507 +/- ##
=======================================
Coverage 84.46% 84.46%
=======================================
Files 217 217
Lines 7196 7196
Branches 1004 1004
=======================================
Hits 6078 6078
Misses 730 730
Partials 388 388 ☔ View full report in Codecov by Sentry. |
| offeringId = offering?.identifier, | ||
| fontProvider = fontProvider, | ||
| shouldDisplayDismissButton = shouldDisplayDismissButton, | ||
| ), |
There was a problem hiding this comment.
I thought maybe we could return the activity in this function so they could finish it whenever they want, but I don't think there's a way by looking at launch. Devs will probably leak the Activity if we did anyways
There was a problem hiding this comment.
Yeah... and we can't really return an activity directly, since we only could have an intent. The system will be in charge of creating the activity.
**This is an automatic release.** ### RevenueCatUI * Paywalls: Add `PaywallFooterView` (#1509) via Toni Rico (@tonidero) * Paywalls: Remove `PaywallActivity` theme to pickup application's theme by default (#1511) via Toni Rico (@tonidero) * Paywalls: Auto-close paywall activity if restore grants required entitlement identifier (#1507) via Toni Rico (@tonidero) ### Bugfixes * Improve pricePerYear price calculation precision (#1515) via Toni Rico (@tonidero) * Improve price per month accuracy for weekly subscriptions (#1504) via Andy Boedo (@aboedo) ### Dependency Updates * Bump danger from 9.4.0 to 9.4.1 (#1512) via dependabot[bot] (@dependabot[bot]) ### Other Changes * Remove unnecessary appInBackground parameters (#1508) via Cesar de la Vega (@vegaro) * Create `PurchasesStateProvider` (#1502) via Cesar de la Vega (@vegaro) Co-authored-by: revenuecat-ops <ops@revenuecat.com>
NachoSoto
left a comment
There was a problem hiding this comment.
This matches the behavior in iOS 👍🏻
Description
Users could potentially restore their purchases and get entitlements granted but the paywall activity was not dismissing. This will add that functionality in the case where users use the
requiredEntitlementIdentifierparameter to launch the activity.This adds a new
PaywallResultvalue,Restored. This will be returned if the last action the user performed was a restore.