Problem Showing Ads on Android when Game Starts without Internet Connection

I’ve had this problem with Unity 5.3.4, 5.3.6 and 5.4.0. However, I am currently trying to fix this on 5.3.6.

If I start the game and there is no Internet connection, of course no ads are shown. If I click the device Home button, start an Internet Connection and then resume the game by clicking on its icon, ads are still not shown, even though a connection is now available.

I can overcome this by removing the game from memory, so that after establishing a connection, the game is not resumed, but started afresh. Ads will then show.

I think that this is not very good for the players. If they connect to the Internet in the middle of the game, they should be able to resume, and get ads (rewarded ads).

So, I added some debug.Log statements and found the following:

  1. With NO Internet Connection, Advertisement.isInitialized returns TRUE (inside a Start() method).
  2. WITH Internet Connection, and after manually initializing with Advertisement.Initialize(“GameID”),
    Advertisement.IsReady() returns ALWAYS false.

How can this be? Am I doing something wrong?

I emphasize that there is no problem when there is an Internet Connection before the game starts.

Hi, sorry for the late reply here, but was waiting for a new version of Ads SDK 2.0 to be published on Asset Store

One of the focus areas during development of Unity Ads SDK 2.0 has specifically been connectivity issues, so I’ll recommend you to integrate Ads SDK 2.0 instead of trying to work around the known issues in SDK 1.5, which you describe above.

SDK 2.0 can be downloaded from https://www.assetstore.unity3d.com/en/#!/content/66123. At the time of writing this, it’s still the beta version available, but RC1 should be ready within a few days.

/Rasmus

Hi, thank for the response.

There’s one thing that I don’t understand. Since Unity 5.2+ we don’t need to import any SDK, since Advertising can just be enabled in the Editor Services tab. So, it seems to me that the SDK is targeted to Unity versions before 5.2, and apparently the SDK 2.0 functionality will be integrated in the core engine at some point.

If my understanding is correct, I should disable the Advertising as a Service, and remove the relative files from the project Assets, before importing SDK 2.0.

Is my understanding correct, or am I missing something?

Correct, plus call Advertisement.Initialize() manually from your code. Plan is that SDK 2.0 will be integrated into Unity 5.5

2 Likes

Same problem here. Is it safe to publish a game with a beta SDK?

I can confirm that while Ads won’t re-initialize in the Editor when you got internet access again, no matter how long you wait. However, it does work on mobile (android to be precise, not tested on iOS). After re-enabling the internet connection ads will be available again. That was done in test mode.

Unity version: 2020.1.4f1
Advertisement package version: 3.4.9

Hope it helps.

1 Like