Android Question Admob Closed event delay

Douglas Farias

Expert
Licensed User
Longtime User
Hi all.
This question specifically is for @Erel creator of lib Firebase Admob for B4A

The admob is notifying me about a delay between closing the ad and opening a new screen (screen transition)

Admob suggests me to strongly use the AdClosed event to open other screens.
But when I make visible on any screen within the AdClosed event there is a delay of milliseconds. something around 200ms to 300ms

Example

I m on screen 1
i click on a buttom, show the interstitial ad.
if i close the interstitial is closed, the AdClosed is called
you can see the screen 1 for around 200ms - 300ms and later this time the screen 2 is visible.

the admob is sending a lot of notifications about it.
it happens in any screen, with many views or 2 or 3 views only.


- i cant open the screen 2 before the ad.show (google admob dont like this)
- i cant open the screen on adclosed because have a delay about 200ms - 300ms and (google admob dont like this).

Obs: The correct way to fix this is open the screens on adclosed event, but i think a good way to fix this is open the screens on this events

B4X:
Sub iad_adopened()
    Log("teste")
End Sub

Sub iad_PresentScreen
    Log("teste")
End Sub

but i dont know if is a b4a or lib bug, because when i open the ad (the ad intesticial is on screen) the logs show only
sending message to waiting queue (iad_adopened)

but dont show the log "teste"

the log test is called only when i close the ad, all code in iad_adopened is ignored, when the ad is opened, the code on iad_adopened is executed only when you close the ad with back key or on X button of admob.

how can i make to execute the code on iad_adopened when the ad is on screen?


The admob want the dev show ad only on screen transitions.
for example

I m on screen 1, show the intersticial, on background i open the screen 2 (with the ad opened), later i close the ad the screen 2 is already on screen opned.


thx
 
Last edited:

Douglas Farias

Expert
Licensed User
Longtime User
Activity events will only be raised when the activity is active. This will happen when the activity resumes.


Why do you need to switch activities at this point?

sorry to dont post more informations, screen = panels, i have only one activity, i open new panels (screen1 is one panel, screen 2 is another panel)
i show intersticial ad on panels transitions.

i m edited the post1 with more infos
 
Upvote 0

Douglas Farias

Expert
Licensed User
Longtime User
I don't understand this. Why AdMob cares about the time it takes your app to change the panel?

Once the interstitial ad is closed the activity is resumed.

i dont know why, the Rogers Reichert (Admob account Manager) contacted me via phone and email talking about this.
for the admob the correct way is

Open panel 1, show instersticial, on background open the panel 2, when you close the ad intesticial the panel 2 is already visible on the screen.
this is the correct way.

but i cant make it with iad_adopened because the code dont is executed when the ad is on screen, only when i close, if i put a panel2.visible = true on
iad_adopened or adclosed event have a delay, i can see the panel 1 for milesseconds before open the panel 2

Example only
91E0E29ADFA1A1BF42097E0699CC491BE874
b_s8GU_V8W_8NjGBGvF2R7rO6Sm6t7-Ai-py6oNB3FbxGSzP9ne0aiPqCIfL=w250
 
Last edited:
Upvote 0
Top