Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Banner Ads not being displayed after app resume #49

Open
uxdxdev opened this issue Mar 20, 2016 · 1 comment
Open

Banner Ads not being displayed after app resume #49

uxdxdev opened this issue Mar 20, 2016 · 1 comment

Comments

@uxdxdev
Copy link

uxdxdev commented Mar 20, 2016

Im having a weird issue with the AdMob ads. When the game starts, the ads are shown, thats fine. If I move to a new scene with Director::getInstance()->replaceScene(); The new scene loads, the ads are there, all is fine.

But on Google Analytics it shows that the active screen is

com.google.android.gms.ads.AdActivity

even though I have set the screen name using

SonarCocosHelper::GoogleAnalytics::setScreenName("Game Scene");

The problem occurs when I press the home button on my Galaxy S4. The app moves to the background, then when it is opened again the banner ads are gone. If I then use the Quit button which calls Director::getInstance()->end(); the screen goes black but the game just reloads, and the ads are displayed again. Its like there is a layer being created over the game showing the ads that is closed when I first hit Quit.

Im putting it down to the com.google.android.gms.ads.AdActivity created for displaying the ads.

How do I get the banner ads to be displayed after the app is resumed from being in the background? Or close the com.google.android.gms.ads.AdActivity view when the game is put in the background and then create it again on resume?

@OscarLeif
Copy link
Contributor

That could be a problem with Cocos helper or Maybe Cocos2d-x itself (your game).
But before check that please can you test that problem in another device ?
I don't remember if that problem with the ads happened before, I remember that ads should appear after you return from the pause activity state. Check android activity lifecycle After all Android ads are like a native activity.
About your game crash maybe you override some methods ? (very common issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants