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

PaywallFooterContainerView not working with New Architecture #1158

Open
5 tasks done
marcibk opened this issue Jan 12, 2025 · 15 comments
Open
5 tasks done

PaywallFooterContainerView not working with New Architecture #1158

marcibk opened this issue Jan 12, 2025 · 15 comments
Assignees
Labels
bug Something isn't working

Comments

@marcibk
Copy link

marcibk commented Jan 12, 2025

Describe the bug
Hello there :)! I tried to implement PaywallFooterContainerView with ReactNative as described in the docs. Unfortunately the footer is cut off at the bottom, not clickable and not movable at all. Anyone figured out how this works? I also saw some open discussions about the footer not being supported for react native since start at all?
Thanks :)

IMG_576777C27B7D-1

    <View style={{ flex: 1 }}>
      <RevenueCatUI.PaywallFooterContainerView>
            <Text>
              Your Custom Paywall Design
          </Text>
        </RevenueCatUI.PaywallFooterContainerView>
    </View>

also tried it without a parent view.

@marcibk marcibk added the bug Something isn't working label Jan 12, 2025
@RCGitBot
Copy link
Contributor

👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!

@Jethro87
Copy link

Hi @marcibk! Is the snippet you shared your full implementation so far, or do you have other parent components? If the latter, can you share a larger snippet so we can determine if anything is conflicting higher up in the tree? Can you also share the version of purchases and purchases-ui SDKs you're using as well as the iOS version of your test device? Thanks!

@garrettwesley
Copy link

Running into the same issue

@Noahkoole
Copy link

Also running into this issue.

@christophemenager
Copy link

christophemenager commented Jan 22, 2025

I have the same issue, to clarify:

  • It's only the case on iOS, android works fine
  • There is a constant offset of around 170px (it's the same offset on the 3 different devices I tried it on)
  • It's easy to reproduce, just copy-past the code in your react native documentation into a screen (I use react-navigation, either displayed as a fullScreenModal or a standard card)

I managed to fixed it this way, by adding a paddingBottom

  <RevenueCatUI.PaywallFooterContainerView
      options={{
        offering: currentOffering,
      }}
      onDismiss={() => {
        // Dismiss the paywall, i.e. remove the view, navigate to another screen, etc.
      }}
      style={{ flex: 1, paddingBottom: Platform.OS === 'android' ? 0 : 170 }}
    >
      <PaywallContent title={null} description={null} />
    </RevenueCatUI.PaywallFooterContainerView>
  );

@vegaro I hope it could help you to solve this kind of critical issue (for now the Footer component is not usable without this workaround), please tell me what I could do to help

EDIT: My bad, this fixes just the UI but buttons are not pressable...

@garrettwesley @Noahkoole did you manage to make the Footer work?

@christophemenager
Copy link

christophemenager commented Jan 22, 2025

I tried downgrading to :

  • 7.18.1
  • 8.1.0

Both are broken

I tried another template :

  • 2 Sphynx
  • 5 Bengal

Both are broken

I suspect this might be linked to my react native config, but I have no time to test to roll back to previous versions. I am currently using:

  • react-native 0.76.6
  • expo 52.0.27
  • latest react-navigation dependencies : 7.2.0
  • latest react-native-screens dependency : 4.5.0
  • ios version 18.2(both SE and Iphone 16 and 16 Pro)

@garrettwesley
Copy link

I tried adding a paddingBottom as well and that works as a quick hack, but none of the buttons are pressable making the Footer completely unusable

@christophemenager
Copy link

Just for the sake of centralizing information about this issue, the Support Team asked me if this problem could be reproduced on another iOS version, the answer is yes.

I tried on ios 18.1 and had the exact same issue (padding + buttons not clickable)

Image

@christophemenager
Copy link

I think I just found the source of the problem: the new architecture:

  • With the new arch enabled on RN 0.76.6, I reproduce the problem
  • Without the new arch enabled on RN 0.76.6 I don't reproduce the problem

@garrettwesley @Jethro87 @marcibk can you tell us if you have the new arch enabled in your project?

@joshdholtz
Copy link
Member

@christophemenager Thanks for looking into this and diagnosing! We will start looking into fixing this on our side today and will try to get a fix out ASAP

@joshdholtz joshdholtz self-assigned this Jan 24, 2025
@garrettwesley
Copy link

Thank you @joshdholtz!

And yes @christophemenager I am running the new arch

@joshdholtz
Copy link
Member

@christophemenager @garrettwesley So we did find why this is happening and its because the reactSetFrame is no longer being used (which we used to properly place the footer position).

There is a Reddit thread (with no answers) of somebody asking how support this. We will keep monitoring that thread for answers while also trying to explore solutions of our own.

I was hoping this was going to be a quick fix from old API to new API but don't have a clear path ATM 🤷‍♂

So in the mean time... RCT_NEW_ARCH_ENABLED=0 pod install (or an equivalent) is the current workout 😬

@joshdholtz joshdholtz changed the title PaywallFooterContainerView not working properly? PaywallFooterContainerView not working with New Architecture Jan 24, 2025
@joshdholtz joshdholtz pinned this issue Jan 24, 2025
@christophemenager
Copy link

@joshdholtz thanks for the investigation and the update 🙏

It's a shame that the react-native team didn't document the migration from the old renderer (using reactSetFrame) to the new one.

My understanding is:

  • There is no equivalent of reactSetFrame as the new architecture introduced a new renderer called Fabric which changes the mindset on how to render a native component in RN.
  • This renderer provides a more "direct" connection between JS and native.
  • You may have read it already, but I found an example on how to display a centered text in iOS with the new Fabric renderer

I hope those hints could help you, I am not an iOS engineer so maybe you already knew all of that!

Hope you will find a solution soon as the new architecture is becoming more and more popular as the RN team is pushing for adoption :)

@joshdholtz
Copy link
Member

@christophemenager Oh, we did some more investigation today and it turns out that is not the issue and I was just having Friday brain moment 🫠

We are still looking into and will still reach out to some React Native maintainers that we know! Will report back as soon as we can 💪

@christophemenager
Copy link

Hi @joshdholtz 👋 Any updates on this issue?

I have seen Paywalls v2 are now released in beta for react-native and seems to support the new architecture, congrats for the launch! 🚀

However, as Paywalls v2 do not support Footer Paywalls, this does not solve this issue 😭

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

7 participants