Skip to main content
Question

Purchase cancelled on hardware back button hit from bank verification redirect

  • October 30, 2025
  • 5 replies
  • 63 views

Forum|alt.badge.img+5

Hello, 

this is all about Android, iOS works fine.

The title sums it all basically. Little code environment context - I do launch a new activity upon purchase under singleTop launchmode. So it’s separated from my singleTask Main Activity.

Now the issue. When user gets a bank redirect to verify payment, it all goes well, everything works, they confirm. But once they go back via the hardware button, the purchase gets cancelled. If they background the bank verification and bring my app forward, it all works as expected. What should about it? Thank you.
 

<activity
android:name=".PurchaseActivity"
android:theme="@style/AppTheme"
android:launchMode="singleTop"
android:taskAffinity="cz.erudita.app"
android:excludeFromRecents="true"
android:alwaysRetainTaskState="true"
android:clearTaskOnLaunch="false"
android:windowSoftInputMode="adjustResize"
android:screenOrientation="portrait"
android:exported="true">

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="cz.erudita.app" android:host="objednavka" />
</intent-filter>
</activity>

 

5 replies

Forum|alt.badge.img+5
  • Author
  • Member
  • October 30, 2025

Oh and I did try to implement a foreground service - that did help with the issue of “staying alive” when the app gets backgrounded on phones with aggressive battery saving settings, but obviously that didn’t solve the hardware button issue. 


alejandra-wetsch
RevenueCat Staff
Forum|alt.badge.img+6

Hey ​@nagram

Thank you for reaching out!

Per my understanding, this could be a limitation of the Google Play Payment sheet, which RevenueCat’s SDK does not handle directly. Having said that, I’ve shared this internally with the Engineering team for them to double-check. I’ll let you know as soon as I have more information!

Best,


guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • November 13, 2025

Hey ​@nagram - just a quick follow up on this and to understand a bit more your flow, you launch your PurchaseActivity upon doing the .purchase() start of the SDK? Do you do anything specific there in between or within the activity?

Or rather, you call the .purchase() from within that PurchaseActivity when a user is looking to start it? 

Meaning, does it resemble something like this?

  • user taps “purchase button
  • you launch the PurchaseActivity
  • some internal logic happens
  • your programmatically start the .purchase() call

Forum|alt.badge.img+5
  • Author
  • Member
  • November 24, 2025

Hey ​@nagram - just a quick follow up on this and to understand a bit more your flow, you launch your PurchaseActivity upon doing the .purchase() start of the SDK? Do you do anything specific there in between or within the activity?

Or rather, you call the .purchase() from within that PurchaseActivity when a user is looking to start it? 

Meaning, does it resemble something like this?

  • user taps “purchase button
  • you launch the PurchaseActivity
  • some internal logic happens
  • your programmatically start the .purchase() call

Hi yes, user clicks the card with the Premium package they like, I start PurchaseActivity, where I immediately run loading screen in UI, do some background checks like whether we’re correctly logged in to revenuecat, whether all is configured, then I programatically run `.purchasePackage`, all goes well, user gets redirect to bank to verify, if they then from the bank click “back to merchant” all is good, if they click hardware button → my app shows cancelled. I did a get an answer from u guys via email where it was said hardware button just automatically triggers cancel, no matter what I do .. so I was just wondering if that’s true, is there really nothing I can do? Is just some beforehand warning all I can do? seems… not good enough


guilherme
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • December 4, 2025

Thanks for mentioning the email response! I've chased that down internally and can confirm what was shared there.

Just to keep this public for anyone else who might encounter this, when a user presses the hardware back button during bank verification or payment redirect, Google Play Billing interprets this as a user-initiated cancellation and returns a USER_CANCELED response to the app. This behavior comes from the Play Store process itself, as it fully controls the purchase flow, and the hardware back action is treated the same as if the user had closed the payment screen intentionally.

This isn't something apps or the RevenueCat SDK can override, since the payment screen belongs to Google or the user's bank. The best approach is to handle this gracefully in your app by treating it as a voluntary cancellation and letting users easily retry their purchase.

Thanks for raising this though, I'll be sure to pass this feedback along to improve our documentation around this behavior.