Skip to content
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

Issue with purchases_ui_flutter Subscription Bypass on Android via Back Button #1070

Open
11 tasks
Errechydy opened this issue May 10, 2024 · 2 comments
Open
11 tasks
Labels
bug Something isn't working

Comments

@Errechydy
Copy link

‼️ Required data ‼️

Do not remove any of the steps from the template below. If a step is not applicable to your issue, please leave that step empty.

There are a lot of things that can contribute to things not working. Having a very basic understanding of your environment will help us understand your issue faster!

Environment

  • Output of flutter doctor
  • Version of purchases-flutter:
  • Testing device version Android API 30.
  • How often the issue occurs: All the time
  • Debug logs that reproduce the issue
  • Steps to reproduce: Show the paywall by calling this:
await RevenueCatUI.presentPaywallIfNeeded(
        entitlementIDRevenueCat,
        displayCloseButton: false,
        );

Then tap on the Back button on the phone, the paywall will disappear, even thought the displayCloseButton: false

Describe the bug

The problem arises when the back button on an Android device is pressed while the paywall is displayed. Instead of maintaining the paywall as expected, it disappears, allowing users to access the app's premium content without subscribing.

Additional context

@Errechydy Errechydy added the bug Something isn't working label May 10, 2024
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@Jethro87
Copy link

Hi @Errechydy, thanks for bringing this up. Unfortunately, we don't yet have a way to override the physical Android back button. What you could do for now is to await the presentPaywallIfNeeded method and then check CustomerInfo for active entitlements. If the user doesn't have an active entitlement, you could call presentPaywallIfNeeded again.

Alternatively, you could use the PaywallView widget and conditionally show it based on active entitlements - docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants