Skip to content

Add result to presentPaywall methods#926

Merged
tonidero merged 7 commits into
paywallsfrom
add-result-present-paywall
Jan 11, 2024
Merged

Add result to presentPaywall methods#926
tonidero merged 7 commits into
paywallsfrom
add-result-present-paywall

Conversation

@tonidero

@tonidero tonidero commented Jan 5, 2024

Copy link
Copy Markdown
Contributor

Adds a PaywallResult enum and makes it the return value of the presentPaywall and presentPaywallIfNeeded methods

@tonidero tonidero force-pushed the add-result-present-paywall branch from a613148 to 0372e4a Compare January 5, 2024 12:15
onPressed: () async {
await RevenueCatUI.presentPaywall();
final paywallResult = await RevenueCatUI.presentPaywall();
log('Paywall result: $paywallResult');

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now I'm only logging this. I did run into some issues getting this log to show for iOS, so I used the dart:developer log method for that which fixed the issue for me.

@tonidero tonidero marked this pull request as ready for review January 9, 2024 09:35
@tonidero tonidero requested a review from a team January 9, 2024 09:35
@tonidero

tonidero commented Jan 9, 2024

Copy link
Copy Markdown
Contributor Author

Still need to update PHC with the fixes in RevenueCat/purchases-hybrid-common#639 but tested locally and seems to be working fine now! Done!

notPresented,
/// Returned when the paywall was presented and the user cancelled without
/// executing an action.
cancelled,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you tap on purchase, cancel, and then purchase again? Would you only get this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would only get the last result before the paywall closed. In this case, the purchase.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooooh when it's closed, got it 👍🏻

@tonidero tonidero merged commit 37aff25 into paywalls Jan 11, 2024
@tonidero tonidero deleted the add-result-present-paywall branch January 11, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants