Skip to main content
Solved

Restore Purchase button on revenue cat paywall doesn not close the paywall - Android SDK

  • February 20, 2026
  • 7 replies
  • 90 views

Forum|alt.badge.img+1

When i launch paywall as in example - the paywall does not close when the user clicks restore purchase button inside the paywall.

 

@OptIn(ExperimentalPreviewRevenueCatUIPurchasesAPI::class)
class MainActivity : AppCompatActivity(), PaywallResultHandler {
private lateinit var paywallActivityLauncher: PaywallActivityLauncher
private lateinit var root: View

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

paywallActivityLauncher = PaywallActivityLauncher(this, this)
}

private fun launchPaywallActivity() {
paywallActivityLauncher.launch(offering = offering)
}

override fun onActivityResult(result: PaywallResult) {}
}
I also tried to use launchIfNeeded() function:
paywallActivityLauncher.launchIfNeeded(offering = offering) { customerInfo ->
customerInfo.entitlements.active.isEmpty()
}


This does not close the paywall either. The paywall doesn’t close regardless of the restore result.
Is there an option for android sdk Activity implementation to change this behaviour?
 

Best answer by duje-8fc3b5

This is the response i got from the official helpdesk at revenue cat. this solved my problem as i only have one entitlement in my app:

Thanks for reaching out, happy to help here!
 
So, the Paywall should auto-close after a restore if it knows which specific entitlement to check for. With the Activity-based approach you're using, that only happens when you pass a requiredEntitlementIdentifier as a string directly.
 
Both of the ongoing methods you are using don't trigger auto-close:

  • launch() doesn't pass any entitlement identifier to the paywall Activity, so it has no way to know when to close;
  • launchIfNeeded { lambda } uses the lambda only to decide whether to show the paywall initially. It doesn't pass any close-after-restore logic to the Activity either

 
The fix is to use the launchIfNeeded overload that takes the entitlement ID as a string (example here in the SDK):

paywallActivityLauncher.launchIfNeeded(
requiredEntitlementIdentifier = "your_entitlement_id",
offering = offering
)

 
Replace "your_entitlement_id" with your actual entitlement from the RevenueCat dashboard (e.g. "pro"). This will only show the paywall if the user doesn't already have that entitlement, and auto-close after a successful restore if they now have it.

7 replies

cam
Forum|alt.badge.img+2
  • Helper
  • February 21, 2026

Hi ​@duje-8fc3b5!

 

I believe you need to programmatically handle the restore paywall result (given success/error) inside of the onActivityResult override to close the activity that triggered paywall launch.

 

Cam


Forum|alt.badge.img+1
  • Author
  • Helper
  • February 21, 2026

Thank you for you answer cam.

I think you misunderstood my question. The problem that I have is that my paywall does’t provide any feedback to the user when one clicks restore purchase. The paywall doesn’t close and there is no any dialog that notifies the user if the restore succeeded or failed. Also I don’t have control over the paywall activity so I can’t close it manually either.

I am not concerned about handling PaywallActivityResult.


cam
Forum|alt.badge.img+2
  • Helper
  • February 21, 2026

My bad! Digging a bit, you might be running into the same issue: 

 


Forum|alt.badge.img+1
  • Author
  • Helper
  • Answer
  • February 23, 2026

This is the response i got from the official helpdesk at revenue cat. this solved my problem as i only have one entitlement in my app:

Thanks for reaching out, happy to help here!
 
So, the Paywall should auto-close after a restore if it knows which specific entitlement to check for. With the Activity-based approach you're using, that only happens when you pass a requiredEntitlementIdentifier as a string directly.
 
Both of the ongoing methods you are using don't trigger auto-close:

  • launch() doesn't pass any entitlement identifier to the paywall Activity, so it has no way to know when to close;
  • launchIfNeeded { lambda } uses the lambda only to decide whether to show the paywall initially. It doesn't pass any close-after-restore logic to the Activity either

 
The fix is to use the launchIfNeeded overload that takes the entitlement ID as a string (example here in the SDK):

paywallActivityLauncher.launchIfNeeded(
requiredEntitlementIdentifier = "your_entitlement_id",
offering = offering
)

 
Replace "your_entitlement_id" with your actual entitlement from the RevenueCat dashboard (e.g. "pro"). This will only show the paywall if the user doesn't already have that entitlement, and auto-close after a successful restore if they now have it.


cam
Forum|alt.badge.img+2
  • Helper
  • February 24, 2026

Thank you for sharing the solution. Now I’m wondering what happens if you don’t know which entitlement the restore is gonna resolve to 😅


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • March 2, 2026

Hi ​@cam,

You should still be able to dismiss the paywall manually after the restore has been successful. You should get a callback if there’s been a successful restore, it doesn’t fire only when there’s nothing to restore.

 

Best,


cam
Forum|alt.badge.img+2
  • Helper
  • March 2, 2026

Thank you ​@joan-cardona, but wouldn’t it still be necessary to add the requiredEntitlementIdentifier on the call to launchIfNeeded?