3
votes

I need some help with Unity. I am developing a simple mobile game and only the ads left. I am using Unity 5.5.3. I did set up everything in the services and included the code which works fine on PC. When i call the ShowAds function it displays a window says "This screen would be your ad unit, everything seems to be working" However, when i build the game and install on android device the Advertisement.IsReady() comes back with false. I have been researching for 2 days now and still no success! So far:

  • Updated Unity to 5.5.4p4
  • Disabled the service and started everything from scratch
  • Created a code which checks the internet connection which comes back with true.
  • Changed the Build Settings/ Player Setting / Internet Access to Require
  • Waited for minutes as some says Initialization sometime takes minutes.

Nothing seems to be working. On mobile there is no ads appearing at all. On PC everything works fine. However on PC i got an error says:

gameID "IDnumber" is not enabled

System.Net.Sockets.Worker:Receive()

I did not find any solution for this error so far.

Here are the codes:

IEnumerator TestInternet(){ 
        WWW internet = new WWW ("http://www.google.com"); 
        yield return internet; 
        if (internet.error != null) {
            alertText.text = internet.error;
        } else {
            alertText.text = "connected";
            if (Advertisement.IsReady ()) {
                Advertisement.Show ();
                alertText.text = Advertisement.IsReady ().ToString();
            } else {
                alertText.text = Advertisement.IsReady ().ToString();
            }
        }
    }
1
Try to wait until advertisement is ready while(!Advertisement.IsReady ()) yield return null; then show it when the while loop exist.Programmer
Thankx for the quick reply. I have tried but the issue remains, unfortunately. Still no ads on mobile just in PC.bontoo
You are using 5.5.4p4 which is really old. I can't tell if that's the issue here but I do think you should download the latest version, make a copy of your project then try it to see if it works with the latest versionProgrammer
Hi! Installed the new 2017.1.1f1 version. Same issue, though. No ads on mobile. I tried on 3 different devices. Same. On PC still works fine.bontoo
Ok. So there is some issue within the game. I just quickly created a new project with one button and it is working fine on mobile. I need to find in the complete project where the mistake is. I think the issue is with the "gameID "IDnumber" is not enabled" part as in the test project it does not appear.bontoo

1 Answers

2
votes

OK! Finally I found a solution. Indeed, there was an issue with the project settings, that is why it gave the "IDnumber is not enabled" error. What I did is from the newly created project i copied all the .asset files and overwrite the existed files in the old project. For me is the following path:

User\Documents\newproject\ProjectSettings\

Now everything works fine. The only downside is that I need to redo some settings such as orientations, etc. I think copying only the UnityConnectSettings.asset would have solved the issue.

Anyway, thanks for everyone for helps!