-
Notifications
You must be signed in to change notification settings - Fork 177
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
Add PaywallView
listeners
#995
Conversation
608ae03
to
b9696b4
Compare
efc9e1d
to
f647a3f
Compare
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.
Nice! Left a few comments about some missing listeners, but I think we can add those in a different PR as well
methodChannel.invokeMethod("onPurchaseError", error) | ||
} | ||
|
||
override fun onRestoreCompleted(customerInfo: Map<String, Any?>) { |
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.
Can we add onRestoreStarted
as well?
) | ||
} | ||
|
||
override fun onPurchaseError(error: Map<String, Any?>) { |
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.
In RN, we split the onPurchaseCancelled
callback. Not sure if we want to do the same here?
..._ui_flutter/android/src/main/kotlin/com/revenuecat/purchases_ui_flutter/views/PaywallView.kt
Outdated
Show resolved
Hide resolved
..._ui_flutter/android/src/main/kotlin/com/revenuecat/purchases_ui_flutter/views/PaywallView.kt
Show resolved
Hide resolved
child: Center( | ||
child: PaywallView(offering: widget.offering,), | ||
body: SafeArea( | ||
child: Center( |
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.
The indentation here seems wrong?
going to merge this for the sake of shipping, and will add more in other PRs |
I wasn't sure what was going on in #995 but there was some issues importing a newly added model. The problem is that we were depending on version ^6.0.0 of purchases_flutter. I made some changes to the pubspec.yaml, so now we use the local plugin. According to [the docs](https://dart.dev/tools/pub/dependencies), "As a result, if you publish a package to pub.dev, keep in mind that your package's dependency overrides are ignored by all users of your package.". So we should be fine to publish it like this.
…-functions-to-full-screen
This PR adds initial listeners to the `PaywallFooterView`. Follow up from #995
**This is an automatic release.** ### New Features * Add `onDismiss` handler and `displayCloseButton` to `PaywallView` and `PaywallFooterView` (#1009) via Toni Rico (@tonidero) * Add `PaywallFooterView` listeners (#1012) via Toni Rico (@tonidero) * Add `PaywallView` listeners (#995) via Cesar de la Vega (@vegaro) ### Bugfixes * Fix footer sizing issues in iOS (#1018) via Toni Rico (@tonidero) ### Dependency Updates * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.2.0 (#1020) via RevenueCat Git Bot (@RCGitBot) * [Android 7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2) * [iOS 4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0) * [iOS 4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1) * [iOS 4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.1.0 (#1013) via RevenueCat Git Bot (@RCGitBot) * [Android 7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2) * [iOS 4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0) * [iOS 4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1) * [iOS 4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0) ### Other Changes * Add 5.8.2 to changelog (#1011) via Cesar de la Vega (@vegaro) * Add dependency_overrides to purchases_flutter_ui (#1007) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Toni Rico <[email protected]>
I wasn't sure what was going on in RevenueCat#995 but there was some issues importing a newly added model. The problem is that we were depending on version ^6.0.0 of purchases_flutter. I made some changes to the pubspec.yaml, so now we use the local plugin. According to [the docs](https://dart.dev/tools/pub/dependencies), "As a result, if you publish a package to pub.dev, keep in mind that your package's dependency overrides are ignored by all users of your package.". So we should be fine to publish it like this.
Added listeners that can be used like: ``` return Scaffold( body: Center( child: PaywallView( onPurchaseStarted: (Package rcPackage) { print('Purchase started for package: ${rcPackage.identifier}'); }, onPurchaseCompleted: (CustomerInfo customerInfo, StoreTransaction storeTransaction) { print('Purchase completed for customerInfo:\n $customerInfo\n ' 'and storeTransaction:\n $storeTransaction'); }, onPurchaseError: (PurchasesError error) { print('Purchase error: $error'); }, onRestoreCompleted: (CustomerInfo customerInfo) { print('Restore completed for customerInfo:\n $customerInfo'); }, onRestoreError: (PurchasesError error) { print('Restore error: $error'); }, ), ), ); ```
This PR adds initial listeners to the `PaywallFooterView`. Follow up from RevenueCat#995
**This is an automatic release.** ### New Features * Add `onDismiss` handler and `displayCloseButton` to `PaywallView` and `PaywallFooterView` (RevenueCat#1009) via Toni Rico (@tonidero) * Add `PaywallFooterView` listeners (RevenueCat#1012) via Toni Rico (@tonidero) * Add `PaywallView` listeners (RevenueCat#995) via Cesar de la Vega (@vegaro) ### Bugfixes * Fix footer sizing issues in iOS (RevenueCat#1018) via Toni Rico (@tonidero) ### Dependency Updates * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.2.0 (RevenueCat#1020) via RevenueCat Git Bot (@RCGitBot) * [Android 7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2) * [iOS 4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0) * [iOS 4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1) * [iOS 4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0) * [AUTOMATIC BUMP] Updates purchases-hybrid-common to 10.1.0 (RevenueCat#1013) via RevenueCat Git Bot (@RCGitBot) * [Android 7.7.2](https://github.com/RevenueCat/purchases-android/releases/tag/7.7.2) * [iOS 4.39.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.39.0) * [iOS 4.38.1](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.1) * [iOS 4.38.0](https://github.com/RevenueCat/purchases-ios/releases/tag/4.38.0) ### Other Changes * Add 5.8.2 to changelog (RevenueCat#1011) via Cesar de la Vega (@vegaro) * Add dependency_overrides to purchases_flutter_ui (RevenueCat#1007) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Toni Rico <[email protected]>
Added listeners that can be used like: