Skip to main content
Solved

Footer-only paywall with Paywall V2?

  • February 25, 2025
  • 3 replies
  • 107 views

Forum|alt.badge.img

How do I create a footer-only v2 Paywall and display it in native Android below another @Composable?

Best answer by joan-cardona

Hi ​@oskarp,

Thanks for sharing this! It’s a pretty smart way to handle it, unfortunately there’s no other way to achieve this but I’ve shared it with the team so we can support it in the future.

 

Best,

View original
Did this post help you find an answer to your question?
This post has been closed for comments

3 replies

joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 409 replies
  • February 27, 2025

Hi ​@oskarp,

Do you have a design image of what you are trying to achieve? I’m not sure I understand the footer-only paywall you mean. You should show your packages somewhere in your paywall.

 

Best,

 


Forum|alt.badge.img
  • Author
  • New Member
  • 2 replies
  • March 6, 2025

This is the paywall I have created in the Paywall Editor. I have created only the footer section of the paywall (see the component tree) but when used with the Android SDK it still takes up the entire screen.

 

 

 


I would like to have the upper part easily customized directly in my code using Jetpack Compose and only have the footer part fetched from the API.

Right now I have it solved like this but there is probably a better way.

 

@Composable
private fun PaywallPager() {
   ...
}

@Composable
fun PaywallScreen(
    setShouldPaywall: (Boolean) -> Unit
) {
    val ENTITLEMENT_ID = "<MY_ENTITLEMENT_ID>"

    Column (
        modifier = Modifier
            .background(colorResource(MR.colors.primaryBackground))
            .fillMaxSize()
    ) {
        Column (
            verticalArrangement = Arrangement.Center,
            horizontalAlignment = Alignment.CenterHorizontally,
            modifier = Modifier
                .weight(1f)
        ) {
            PaywallPager()
        }

        Box (
            Modifier
                .height(IntrinsicSize.Min)
        ) {
            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(),
            )
        }
    }
}

 


joan-cardona
RevenueCat Staff
Forum|alt.badge.img+6
  • RevenueCat Staff
  • 409 replies
  • Answer
  • March 12, 2025

Hi ​@oskarp,

Thanks for sharing this! It’s a pretty smart way to handle it, unfortunately there’s no other way to achieve this but I’ve shared it with the team so we can support it in the future.

 

Best,


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings