Remove result from presentPaywall methods#916
Merged
Conversation
tonidero
commented
Jan 2, 2024
| paywallResult -> result.success(paywallResult instanceof PaywallResult.Purchased) | ||
| requiredEntitlementIdentifier | ||
| ); | ||
| result.success(null); |
Contributor
Author
There was a problem hiding this comment.
In iOS, we were already just returning null (which was causing #886), so no changes needed there.
vegaro
approved these changes
Jan 2, 2024
Merged
tonidero
added a commit
that referenced
this pull request
Jan 5, 2024
### New features * 📱 Initial support for cross-platform RevenueCat Paywalls 🐾 🧱 (#852) #### Instructions: - For Android, you need to change your `MainActivity` to subclass `FlutterFragmentActivity` instead of `FlutterActivity`. Also, the min sdk version of the new package is `24`. Please make sure your app's `android/build.gradle` minSdkVersion has that or a higher version. - Add `purchases-ui-flutter` in your `pubspec.yaml`: ```yaml dependencies: purchases_ui_flutter: 6.15.0-beta.4 ``` #### Usage: ```dart import 'package:purchases_ui_flutter/purchases_ui_flutter.dart'; await RevenueCatUI.presentPaywallIfNeeded("pro"); ``` #### Limitations: - Currently only full screen paywalls are supported - There is no way to detect paywall events other than using `addCustomerInfoUpdateListener` #### Breaking changes from previous beta: - Paywalls functionality has been extracted into a new dependency called purchases_ui_flutter. Add purchases_ui_flutter to your pubspec.yaml. Before this release, it was part of the main RevenueCat SDK `purchases_flutter`. - A new import is required to use this functionality: `import 'package:purchases_ui_flutter/purchases_ui_flutter.dart';` - Usage has changed the class from `Purchases.presentPaywall` to `RevenueCatUI.presentPaywall`. - `presentPaywall` and `presentPaywallIfNeeded` now don't return a result. To detect purchases, please use `Purchases.getCustomerInfo` from the `purchases_flutter` SDK. A return value will be added in future releases. ### Other Changes * Fix pub score for `purchases-ui-flutter` (#924) via Toni Rico (@tonidero) * Update `paywalls` to latest `main` (#923) via Toni Rico (@tonidero) * Rename `purchases_flutter_ui` to `purchases_ui_flutter` (#921) via Toni Rico (@tonidero) * Separate paywalls into a different package (#919) via Toni Rico (@tonidero) * Remove result from presentPaywall methods (#916) via Toni Rico (@tonidero) * Update to use PHC PaywallHelpers instead of custom activity (#903) via Toni Rico (@tonidero)
NachoSoto
reviewed
Jan 8, 2024
| } else { | ||
| print("Purchase failed"); | ||
| } | ||
| await Purchases.presentPaywall(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently the
presentPaywallandpresentPaywallIfNeededmethods return a boolean indicating whether a purchase happened in the paywall. This API is confusing and not extensible and it wasn't properly working in iOS, see: #886. This first PR removes the return value from the method. In a future PR we will add proper result handling for the paywalls. Until then, the clients won't know what happened when the paywall was presented and will need to rely on thePurchases.getCustomerInfo()method to respond appropriately.This is a breaking change from the previous beta.