capacitor-community / admob

Community plugin for using Google AdMob
MIT License
205 stars 66 forks source link

live test ad only showing the first time consent is accepted #294

Closed mledwards closed 8 months ago

mledwards commented 8 months ago

Hello, thanks for all your work on a great plugin!

I've just got to the point of testing live test ads with the code below. And I've added the GDPR / consent message via Google AdMob privacy and messaging.

In android simulator the consent window comes up, and once accepted the banner shows at the bottom of the game. But if I restart the app / device in any way, the consent window doesn't show up (which is what I would expected), but the ad doesn't appear.

Logcat shows: Ad failed to load : 3

Any ideas what this could be? And whether it will persist in production?

I was wondering if it's something to do with the code example here: https://github.com/capacitor-community/admob#user-message-platform-ump, it doesn't look like it's adding much compared to the initialize() code example that I used, so I didn't change anything in particular.

await AdMob.initialize({
    initializeForTesting: true,
    testingDevices: ["MY_DEVICE_ID_HERE"],
});
distante commented 8 months ago

That is an Admob error. "No fill".

If your app is not published yet you will never get fill for real ads. Even for testing.

mledwards commented 8 months ago

Hi @distante, the ads worked on production. But only on accept of the consent for on the android simulator. I'll keep digging, see what comes up.

distante commented 8 months ago

If you use testing ads (not real ads for testing devices) it would always come.

mledwards commented 8 months ago

Yeah, that worked, but not real ads for testing devices, via initializeTesting