purchases-flutter icon indicating copy to clipboard operation
purchases-flutter copied to clipboard

Neither the Android device hardware Back button nor 'back' gesture dismiss the Paywall

Open JaseElder opened this issue 8 months ago • 4 comments

‼️ 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

  • [x] Output of flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.2 24D81 darwin-x64, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] IntelliJ IDEA Community Edition (version 2024.3.1.1)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

  • [x] Version of purchases-flutter
  purchases_ui_flutter: ^8.7.0
  purchases_flutter: ^8.7.0
  • [x] Testing device version e.g.: iOS 15.5, Android API 30, etc. Android API 28 (hardware back button) Android API 34 (back gesture)

  • [x] How often the issue occurs- every one of your customers is impacted? Only in dev? Always on those devices at least.

  • [x] Debug logs that reproduce the issue The only output on tapping the hardware Back button:

D/ViewRootImpl@ea3d903[MainActivity]( 1010): ViewPostIme key 0
D/ViewRootImpl@ea3d903[MainActivity]( 1010): ViewPostIme key 1
D/[Purchases]( 1010): Paywalls: Close paywall initiated
D/[Purchases] - DEBUG( 1010): Tracking event: PaywallEvent(creationData=CreationData(id=aecf758b-cdba-40ee-997a-32ddae9eb962, date=Mon Apr 07 15:26:59 GMT+01:00 2025), data=Data(offeringIdentifier=default, paywallRevision=22, sessionIdentifier=eb32140d-f3bf-4f91-a96d-41c588d5512b, displayMode=footer, localeIdentifier=en_GB, darkMode=true), type=CLOSE)
  • [x] Steps to reproduce, with a description of expected vs. actual behavior Open a paywall that uses OriginalTemplatePaywallFooterView(). Dismissing it using the device os features doesn't work. It would be expected that hitting the hardware back button or swiping back on the screen would dismiss it.

Describe the bug

Open a paywall that uses OriginalTemplatePaywallFooterView(). The paywall is invoked with showModalBottomSheet<PaywallResult>() Dismissing the paywall via the hardware Back button or a back swipe gesture doesn't dismiss the modal. Also, the onDismiss callback of OriginalTemplatePaywallFooterView() is not triggered. The modal can be dismissed by either tapping the non-modal background, or swiping down on the paywall footer.

JaseElder avatar Apr 07 '25 14:04 JaseElder

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

RCGitBot avatar Apr 07 '25 14:04 RCGitBot

Hi @JaseElder can you provide me with the following:

  • Your full paywall code
  • RevenueCat debug logs for this, see our docs here

HaleyRevcat avatar Apr 09 '25 16:04 HaleyRevcat

Hi @HaleyRevcat ,

Here is a minimal, one file version of the paywall code we're invoking. I've stripped out all unnecessary dependencies and only included the full widget journey for showing the paywall. If you want to test independently, it should be enough to call Navigator.of(context).push(MaterialPageRoute(builder: (context) => const MinimalAppMenu())); on some screen.

minimal_paywall.dart.zip

And here are the logs. I ran the app twice, the second time as a fresh install. It should be noted that, for some reason at the moment, RevenueCat is always starting with this error: W/[Purchases] - WARN( 9689): ⚠️ Unable to start a network connection due to a network configuration issue: Hostname api.revenuecat.com not verified: and going to show the paywall footer initially will show a loading placeholder, and then will eventually (after 3 or 4 minutes) load in with the correct offers. This behaviour seems to be sporadic, but it's happening more often than not. Today is the first time I've seen it. The internet connection here is solid. It will always eventually load in.

At the end of each run, I've tapped the hardware button twice, so this is logged:

D/ViewRootImpl@6d7e670[MainActivity]( 9689): ViewPostIme key 0
D/ViewRootImpl@6d7e670[MainActivity]( 9689): ViewPostIme key 1
D/[Purchases]( 9689): Paywalls: Close paywall initiated
D/[Purchases] - DEBUG( 9689): Tracking event: PaywallEvent(creationData=CreationData(id=1320ae03-c54f-44a1-ac01-e81bbe9b7b11, date=Wed Apr 09 21:23:49 GMT+01:00 2025), data=Data(offeringIdentifier=default, paywallRevision=22, sessionIdentifier=1cc8362f-687e-4aee-91fc-77286c776d99, displayMode=footer, localeIdentifier=en_GB, darkMode=true), type=CLOSE)
D/ViewRootImpl@6d7e670[MainActivity]( 9689): ViewPostIme key 0
D/ViewRootImpl@6d7e670[MainActivity]( 9689): ViewPostIme key 1
D/[Purchases]( 9689): Paywalls: Close paywall initiated

i.e. there is an initiation two times, but only the first time is there a tracking event, and neither time does the modal dismiss.

first_logs.txt second_logs.txt

JaseElder avatar Apr 09 '25 20:04 JaseElder

I think I have the same problem with PaywallView: #1341

rignaneseleo avatar May 08 '25 10:05 rignaneseleo

Reopening issue. It was closed due to a failing automation. Sorry about that.

vegaro avatar Sep 22 '25 07:09 vegaro

Hi @JaseElder @rignaneseleo , I'm very sorry about the delay on this reply. We've been auditing our ticketing system and found that your ticket was never resolved. Are you still having this issue? If yes can you let me know if our most recent SDKs 8.11.0 or 9.7.0 fixes this for you?

HaleyRevcat avatar Oct 03 '25 00:10 HaleyRevcat

Hi @HaleyRevcat , the issue has been resolved for me.

Thank you.

JaseElder avatar Oct 03 '25 11:10 JaseElder