AdMob Plugin for Unity3D HELP!!

638 views
Skip to first unread message

Nurtaç Kurtel

unread,
Apr 7, 2014, 6:18:52 AM4/7/14
to google-adm...@googlegroups.com
I download AdMob Plugin for Unity3D this link:https://codeload.github.com/googleads/googleads-mobile-plugins/zip/v2.0
I'm trying to create a banner. But does not create a banner. Only said "Dummy LoadAd"

My code:

        BannerView view1;
AdRequest req1;
// Use this for initialization
void Start () {
view1 = new BannerView ("My-ad-unit", AdSize.Banner, AdPosition.Top);
req1 = new AdRequest.Builder ().AddTestDevice(AdRequest.TestDeviceSimulator).Build ();
}
// Update is called once per frame
void Update () {
if(Input.GetKeyDown(KeyCode.Mouse0))
  view1.LoadAd(req1);
}

Help me please!

Eric Leichtenschlag

unread,
Apr 7, 2014, 8:50:54 PM4/7/14
to google-adm...@googlegroups.com
Hi Nurtac,

That means everything is working as expected so far. Mobile ads can only serve when running on mobile devices/simulators, but not in the Unity editor. So when you're running in the editor, the calls to the native mobile framework are replaced with a dummy implementation to avoid errors in the editor. Try running the app on a mobile device.

Thanks,
Eric

Nurtaç Kurtel

unread,
Apr 8, 2014, 4:36:44 AM4/8/14
to google-adm...@googlegroups.com
Hi Eric,

I think "hashed_test_id" necessary. Where can I learn from this. Because i try to run my game in my device. But did not display any banner.


Eric Leichtenschlag

unread,
Apr 8, 2014, 3:36:40 PM4/8/14
to google-adm...@googlegroups.com
If you're running on Android, you can get this from the logcat output. You would need to have adb installed, and adb logcat should have logs for this.

On iOS, XCode has a panel displaying logs, and the device ID is found there.

That said, you should still be able to get fill even if you didn't input the test device ID. Hopefully you're using a real ad unit ID. Once you have access to the logs, there should be an error reason why the ad didn't come back. You could actually also check the error from within Unity:

view1.AdLoaded += HandleAdLoaded;
view1
.AdFailedToLoad += HandleAdFailedToLoad;
...

public void HandleAdLoaded()
{
   
print("HandleAdLoaded event received.");
}

public void HandleAdFailedToLoad(string message)
{
 
print("HandleFailedToReceiveAd event received with message: " + message);
}

to see what's going on.

Thanks,
Eric

Nurtaç Kurtel

unread,
Apr 9, 2014, 4:46:23 AM4/9/14
to google-adm...@googlegroups.com
Hi Eric,

First of all; I searced my device id in Logcat. But I didn't find anyting. And I searced associated with device id in Unity Script Reference. I found a script(SystemInfo.deviceUniqueIdentifier). Hopefully they are the same.

Secondly; You said,"Hopefully you're using a real ad unit ID". I have added my app at my admob account. I created an ad unit(ad unit id: ca-app-pub-...). But I didn't connect it to an app from Google Play Store.

Finally; You gave scripts didn't react anything. And I have a favor to ask you. Can you make a tutorial video ?

Eric Leichtenschlag

unread,
Apr 9, 2014, 6:43:32 PM4/9/14
to google-adm...@googlegroups.com
Hi Nurtac,

The device ID that AdMob needs to request test ads is different from Unity's SystemInfo.deviceUniqueIdentifier.

Can you try using the HelloWorld sample app provided with the plugin? Make sure to replace the ad unit ID with your "ca-app-pub-..." id.

Thanks,
Eric
Reply all
Reply to author
Forward
0 new messages