In my Android Jetpack Compose app I am using
com.revenuecat.purchases:purchases 8.14.0 and com.revenuecat.purchases:purchases-ui 8.14.0.
The paywall is displayed like this:
import com.revenuecat.purchases.CustomerInfo
import com.revenuecat.purchases.models.StoreTransaction
import com.revenuecat.purchases.ui.revenuecatui.Paywall
import com.revenuecat.purchases.ui.revenuecatui.PaywallListener
import com.revenuecat.purchases.ui.revenuecatui.PaywallOptions
...
Paywall(
PaywallOptions.Builder({})
.setListener(object : PaywallListener {
override fun onPurchaseCompleted(
customerInfo: CustomerInfo,
storeTransaction: StoreTransaction
) {
if (customerInfo.entitlements.active.containsKey(ENTITLEMENT_ID)) {
setShouldPaywall(false)
}
}
override fun onRestoreCompleted(customerInfo: CustomerInfo) {
if (customerInfo.entitlements.active.containsKey(ENTITLEMENT_ID)) {
setShouldPaywall(false)
}
}
})
.build(),
)
How can I catch and handle any errors that occurs when, for example, fetching the offerings?
I am currently in the situation where I have developed and configured my app to only be available in Sweden. But when submitting the app for review it gets rejected because it is (probably) reviewed in the US.
This results in a configuration error that I can also reproduce if I create and login with a US Google Account on my Android device or emulator.
Similar errors occurs if the user does not have an internet connection. How can I catch and customize the displayed error?

This seems similar to
but I do not know how to properly catch the error and display my own.