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

[🐛][iOS][old-arch] Advertiser assets outside native ad view #700

Open
1 task
dylancom opened this issue Jan 24, 2025 · 0 comments
Open
1 task

[🐛][iOS][old-arch] Advertiser assets outside native ad view #700

dylancom opened this issue Jan 24, 2025 · 0 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@dylancom
Copy link
Collaborator

dylancom commented Jan 24, 2025

What happened?

With some native ads (old arch) the native ad validator shows the error: "Advertiser assets outside native ad view".
The error occurs when the height of <NativeAdView /> includes a decimal value. For e.g. 637.3333129882812

Xcode console: "Google:HTML Not all asset views lie inside the native ad view. This indicates an integration problem. Such implementations will not be supported in the future. Please make sure that all native ad assets are rendered inside the native ad view."

TEMP FIX:

const [height, setHeight] = useState(0);

<NativeAdView
  nativeAd={nativeAd}
  style={{height: height || 'auto'}}
  onLayout={e => {
    if (!height) {
      setHeight(Math.ceil(e.nativeEvent.layout.height));
    }}
  }}
>
Image

Platforms

iOS, but have not tested behavior on Android

React Native Info

example app

Are your using Typescript?

  • My project is using Typescript

package.json

example app

app.json

example app

ios/Podfile

android/build.gradle

android/app/build.gradle

android/settings.gradle

AndroidManifest.xml

@dylancom dylancom added the help wanted Extra attention is needed label Jan 24, 2025
@dylancom dylancom changed the title [🐛][iOS] Advertiser assets outside native ad view [🐛][iOS][old-arch] Advertiser assets outside native ad view Jan 24, 2025
@dylancom dylancom pinned this issue Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants