Closed usmanr626 closed 6 months ago
I encountered a similar issue and solved it. I hope the code will help you. :)
<Button title="showAds" onPress={async () => { let loaded = false; const adUnitId = __DEV__ ? TestIds.REWARDED : "ca-app-pub-xxxxxxxxxxxxx/yyyyyyyyyyyyyy"; const admob = RewardedAd.createForAdRequest(adUnitId, { requestNonPersonalizedAdsOnly: true, }); const unsubscribeLoaded = admob.addAdEventListener(RewardedAdEventType.LOADED, () => { loaded = true; console.log("ads loaded"); unsubscribeLoaded(); }); const unsubscribeEarned = admob.addAdEventListener(RewardedAdEventType.EARNED_REWARD, (reward) => { console.log("User earned reward of ", reward); unsubscribeEarned(); }); const showAds = async () => { admob.load(); while (!loaded) await sleep(1000); admob.show(); }; await showAds(); }} />
Still getting the same error, the issue is that admob.load() (or rewarded.load() in my case) doesn't work and so the listener doesn't register anything. And since the ad isn't loaded , it shows the error when I try to call admob.show() (rewarded.show() in my case)
const unsubscribeLoaded = admob.addAdEventListener( RewardedAdEventType.LOADED, () => { loaded = true; console.log('ads loaded'); //can't get to this part because the ad doesn't load unsubscribeLoaded(); }, );
all of this is happening only on rewarded and rewardedInterstitial ads for android app open ads and interstitial ads are working fine, and all ads work fine on ios
Eu resolvi dessa forma...
Envolva seu código de exibição em um block try
function showAdsOnPress() {
try {
rewarded.show();
} catch (error) {
console.log(Falhou ao abrir
, error);
rewarded.load();
}
}
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Nothing work anymore since this google consent update... Always getting Error: [googleMobileAds/no-fill] No fill. even with TestAds (for rewardedAd) and ERROR Advert failed to load community: [Error: [googleMobileAds/error-code-no-fill] The ad request was successful, but no ad was returned due to lack of ad inventory.] for banners ads
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
@akaoppa were you able to find any solution?
Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time.Has this issue been fixed, or does it still require attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
I encountered a similar issue and solved it. I hope the code will help you. :)
<Button title="showAds" onPress={async () => { let loaded = false; const adUnitId = __DEV__ ? TestIds.REWARDED : "ca-app-pub-xxxxxxxxxxxxx/yyyyyyyyyyyyyy"; const admob = RewardedAd.createForAdRequest(adUnitId, { requestNonPersonalizedAdsOnly: true, }); const unsubscribeLoaded = admob.addAdEventListener(RewardedAdEventType.LOADED, () => { loaded = true; console.log("ads loaded"); unsubscribeLoaded(); }); const unsubscribeEarned = admob.addAdEventListener(RewardedAdEventType.EARNED_REWARD, (reward) => { console.log("User earned reward of ", reward); unsubscribeEarned(); }); const showAds = async () => { admob.load(); while (!loaded) await sleep(1000); admob.show(); }; await showAds(); }} />
Still getting the same error, the issue is that admob.load() (or rewarded.load() in my case) doesn't work and so the listener doesn't register anything. And since the ad isn't loaded , it shows the error when I try to call admob.show() (rewarded.show() in my case)
const unsubscribeLoaded = admob.addAdEventListener( RewardedAdEventType.LOADED, () => { loaded = true; console.log('ads loaded'); //can't get to this part because the ad doesn't load unsubscribeLoaded(); }, );
all of this is happening only on rewarded and rewardedInterstitial ads for android app open ads and interstitial ads are working fine, and all ads work fine on ios
Thanks its helped me alot ^^
What happened?
I am getting this error RewardedAd.show() The requested RewardedAd has not loaded and could not be shown, I have called rewarded.show() on a button press, its working fine on iOS but getting this error on android, also it was working fine like a week ago.
the library I am using : "react-native-google-mobile-ads": "^12.1.2",
useEffect(() => { const unsubscribeLoaded = rewarded.addAdEventListener( RewardedAdEventType.LOADED, () => { setLoaded(true); console.log('Rewarded Ad Loaded'); }, ); const unsubscribeEarned = rewarded.addAdEventListener( RewardedAdEventType.EARNED_REWARD,
}, []);
I have called a function on a button press
const showAd = async () => {
setReloadAd(false); setTimeout(() => { rewarded.show(); }, 3000); };
wether I use the setTimeout or not, I can't get it to work on Android.
although Interstitial ads are working perfectly
Platforms
Only on Android
React Native Info
Are your using Typescript?
package.json
app.json
ios/Podfile
No response
android/build.gradle
android/app/build.gradle
android/settings.gradle
AndroidManifest.xml