Admob not firing "clicked" event phase (in test Mode)

Hi all,

I’ve been diving into the tricky world of Admob. So far so good, but I have three questions:

  1. I am not getting a “clicked” event.phase in testMode. Is this normal? Is this automatically ‘fixed’ when you are using real ads, and no longer testMode?

  2. Is there a way to programmatically detect is an app is running in development (on device) or as a final distribution build? That would make switching testMode on and off a lot easier than needing to edit the code manually for final build.

  3. Does an Admob ad automatically disappear when you click it? It doesn’t for me at the moment. Maybe this is related to testMode.

Thanks for any help! Much appreciated!

Thomas

1 Like

For me, clicking an AdMob test banner takes me to developers.google.com

Clicking on an AdMob test video interstitial gives an unsatisfying response. I use the correct test IDs as listed here:


ca-app-pub-3940256099942544/5135589807 (interstitial video)

Clicking the upper half of the ad pauses and resumes it. Clicking the lower half does nothing unless I click on the ‘Get’ button. Then it results in a nearly fully white screen. Looks like it’s trying to connect to Google Play from my iPad.

Mobile ads have been the bane of my life since 2013. Always troublesome.

I just tried to check the console to see if the click event is detected.

Alas, I cannot. I get ‘there is a problem linking the app’ and it’s related to AdMob. This happens sometimes for me with the Xcode simulator when using AdMob. :frowning:

As I said, mobile ads have been the bane of my life since 2013. Always troublesome. Sigh.

@thomasvandenabeele Can you use the Xcode simulator with AdMob?

ERROR: Builder failed: ld: warning: ignoring file /Users/xx/Desktop/xx.app/.build/plugin.admob/GoogleMobileAds.framework/GoogleMobileAds, missing required architecture i386 in file /Users/xx/Desktop/xx.app/.build/plugin.admob/GoogleMobileAds.framework/GoogleMobileAds (1 slices)
Oct 03 07:20:59.779 Undefined symbols for architecture i386:

  1. I did not find the “clicked” implemented in the plugin source code. I checked both Android and iOS versions. Is there documentation that states it should be available.
  2. Not that I am aware of.
  3. No ads don’t disappear from my experience.

The plugin does not have i386 slice and will not run in the simulator.

1 Like

Here’s the clicked event.phase documentation for AdMob

For what it’s worth I have had the AdMob plugin run successfully in the Xcode simulator recently.

Thanks agramonte - always appreciate your replies. Happy coding. :slight_smile:

For what it’s worth: I got adMob up and running smoothly in a distribution build on the App Store!

My findings:

  1. There is no “clicked” event.phase in this plugin. I’ve tested this in a final, built and distributed app (iOs in the App Store). You get a “displayed” event, and a “closed” event when you manually close the ad.
  2. Yes, you do need to close the ad yourself, even after clicking it.
  3. You actually need your app up and running before adMob let’s you really download Ads. This is a bit confusing because you don’t want to upload a final build before knowing if this will work, but the steps are:
  • set up your app and ad unit in admob
  • use testMode while developing
  • in the end, turn off testMode but make sure you DON’T click on ads from a development build as this will get you banned.
  • code a failSafe in case no ad is available
  • build and deliver to the app store
  • once the app is built and available on the App Store complete the setup in adMob
  • after that the app will download true ads.
1 Like

My test ads on iOS still try to open Google Play when clicked - as per screenshot above. Weird.

I wouldn’t worry about that since it’s just a test ad. Surely adMob is smart enough to detect your device in real ads and if applicable show an Apple App Store ad.

1 Like