-
Notifications
You must be signed in to change notification settings - Fork 53
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: Auto-close paywall activity if restore grants required entitlement identifier #1507
Conversation
finish() | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮💨 ok, should have kept reading
sorry for the noise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
requiredEntitlementIdentifier
parameter to launch the activity.This adds a new
PaywallResult
value,Restored
. This will be returned if the last action the user performed was a restore.