0

I am using react-native-google-mobile-ads in a @shopify/flash-list list, and it functions as expected except the nature of flash-list is recycling the ad banner component over and over again as it's supposed to. The ad never changes. The React Native Google Mobile Ads docs say "to reload/change an advert for a currently mounted component, you'll need to force a re-render..."

Any ideas on how to do this?

React Native Google Mobile Ads Banner Ads Docs

import React from 'react';
import { BannerAd, BannerAdSize, TestIds } from 'react-native-google-mobile-ads';

const adUnitId = __DEV__ ? TestIds.BANNER : 'ca-app-pub-xxxxxxxxxxxxx/yyyyyyyyyyyyyy';

function AdmobListAd({ keywordsArr }) {
  return (
    <BannerAd
      unitId={adUnitId}
      size={BannerAdSize.ANCHORED_ADAPTIVE_BANNER}
      requestOptions={{
        requestNonPersonalizedAdsOnly: true,
        keywords: keywordsArr 
      }}
    />
  );
}

export default AdmobListAd;
Cory
  • 113
  • 9

0 Answers0