Я пытаюсь внедрить React-Native-Google-Mobile-Ads в свое приложение. Сейчас я сосредоточен только на Android и пытаюсь сначала заставить работать образец BannerAd.
Я следовал этому руководству и не использую expo:
https:// docs.page/invertase/react-native-google-mobile-ads
Как только я выполнил все шаги и ввел:
Код: Выделить всё
Error while updating property 'request' of a view managed by: RNGoogleMobileAdsBannerView
null
No virtual method addNetworkExtrasBundle( ... )
I couldn't find anyone else having the same issue, hoping to see if anybody else has ran into this same issue.
I followed all of the steps in the guide:
https://docs.page/invertase/react-nativ ... mobile-ads
I've updated my app.json with
Код: Выделить всё
"react-native-google-mobile-ads": {
"android_app_id": "ca-app-pub-xxxxxxxx~xxxxxxxx" {
const initializeAds = async () => {
try {
mobileAds()
.setRequestConfiguration({
testDeviceIdentifiers: ['EMULATOR'],
})
.then(() => {});
mobileAds().initialize();
console.log('Google Mobile Ads SDK initialized successfully.');
} catch (error) {
console.error('Error initializing Google Mobile Ads SDK:', error);
}
};
initializeAds();
return () => {
// Cleanup code here if needed
};
}, []);
Источник: https://stackoverflow.com/questions/781 ... mobileadsb