I am using Jetpack Compose in my Android app. I have created a composable screen in which based on the user (Free or Premium), I show the paywall. Now, when the user makes a successful purchase, my composable screen is getting dismissed automatically. I am using the below code if the user is not premium.
PaywallDialog(
PaywallDialogOptions.Builder()
.setOffering(currentOffering)
.setFontProvider(CustomFontProvider(RobotoFontFamily))
.setDismissRequest { onNavigateUp() }
.setListener(
object : PaywallListener {
override fun onPurchaseCompleted(
customerInfo: CustomerInfo,
storeTransaction: StoreTransaction
) {
onPurchaseOrRestoreCompleted()
}
override fun onRestoreCompleted(customerInfo: CustomerInfo) {
onPurchaseOrRestoreCompleted()
}
}
)
.build()
)
Now, the problem is once the purchase is done, I am updating the user status from free to premium and based on that I want to show the plan information and other details on the same screen. But, as soon as the purchase is done, the user is redirected back to the previous screen. I don’t want that behavior.
Is this possible or am I missing something?