Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose Default Alert Dialog is shown for Paywall error callbacks #297

Open
7 of 10 tasks
mirzemehdi opened this issue Jan 23, 2025 · 1 comment
Open
7 of 10 tasks
Labels
bug Something isn't working

Comments

@mirzemehdi
Copy link

mirzemehdi commented Jan 23, 2025

Describe the bug

I am not sure if this would be bug, or feature request. I am using Paywall UI. In success result (purchase or restore) I get callback and based on that I show my custom successful view to the user, which is nice. But for error callbacks, it shows by default compose alert dialogs, but in whole application I want to use my custom error view. In this case I left with two options

  1. First option don't show any error view, assume needed error view will be handled by RevenueCat, and will show default Compose Dialog.
  2. Show both custom dialog and Compose Error Dialog that comes with RevenueCat.

I think it would be good idea to make that error decision to end user, instead of showing default alert dialog. Or giving an option to hide/disable that.

Image

val paywallOptions = remember {
        PaywallOptions(dismissRequest = { onDismiss() }) {
            this.shouldDisplayDismissButton = true
            this.listener = object : PaywallListener {
                override fun onPurchaseCompleted(
                    customerInfo: CustomerInfo,
                    storeTransaction: StoreTransaction
                ) {
                    //Successful payment
                    super.onPurchaseCompleted(customerInfo, storeTransaction)
                    AppLogger.d("Successful payment, onPurchaseCompleted")
                    successfulPurchaseOrRestore = true

                }

                override fun onPurchaseError(error: PurchasesError) {
                    super.onPurchaseError(error)
                    AppLogger.e("There was an error with purchase: $error")
                }

                override fun onRestoreCompleted(customerInfo: CustomerInfo) {
                    super.onRestoreCompleted(customerInfo)
                    AppLogger.d("Successful restore, onRestoreCompleted")
                    successfulPurchaseOrRestore = true
                }

                override fun onRestoreError(error: PurchasesError) {
                    super.onRestoreError(error)
                    AppLogger.e("There was an error with restore purchase: $error")
                }
            }
        }
    }
    Paywall(options = paywallOptions)

  1. Environment
    1. Platform: android
    2. SDK version:
    3. OS version:
    4. IDE (e.g. Android Studio, Xcode, Fleet): Android Studio
    5. IDE version:
    6. Device and/or emulator/simulator:
      • Device
      • Emulator/simulator
    7. Environment:
      • Closed testing / Sandbox
      • TestFlight
      • Production
    8. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to
    have context, eg. stackoverflow, etc.)

Additional context
Add any other context about the problem here.

@mirzemehdi mirzemehdi added the bug Something isn't working label Jan 23, 2025
@JayShortway
Copy link
Member

JayShortway commented Jan 23, 2025

Hi @mirzemehdi, thank you for this feature request! I'll discuss it with the rest of the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants