My admob banner ads showing fine but not clickable UNITY3D

589 views
Skip to first unread message

Kahfi Alghiffari

unread,
Oct 11, 2015, 12:51:14 PM10/11/15
to Google Mobile Ads SDK Developers
Hi there,

I have been trying to figure out a major issue on my game . My admob banner ad is showing just fine and attached to the camera but the issue is that the ads are not clickable.
Here's the preview of my code :

details: UNITY3D version : 4.6
           Official admob plugin version : 2.3.0 or 2.3.1 (forgot)

my Assets>Plugins>Android>GoogleMobileAdsPlugin AndroidManifest.xml 

<?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   
package="com.google.unity"
   
android:versionName="1.0"
   
android:versionCode="1">
 
<uses-sdk android:minSdkVersion="9"
     
android:targetSdkVersion="19" />
 
<!-- Google Mobile Ads Permissions -->
 
<uses-permission android:name="android.permission.INTERNET"/>
 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 
<!-- Uncomment to add billing for in-app purchase ads -->
 
<!--<uses-permission android:name="com.android.vending.BILLING"/> -->
 
<application>
       
<!-- Admob Plugin value="true" -->
   
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik"
               
android:value="true" />
   
<!-- Denote the referenced Google Play services version -->
   
<meta-data android:name="com.google.android.gms.version"
       
android:value="@integer/google_play_services_version" />
   
<!-- Google Mobile Ads Activity -->
       
<activity android:name="com.google.android.gms.ads.AdActivity"    
                         
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
   
<!-- InAppPurchase Activity -->
   
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
       
android:theme="@style/Theme.IAPTheme"/>
 
</application>

my
 BannerAd.cs which is attached in the camera

using UnityEngine;
using System.Collections;
using GoogleMobileAds;
using GoogleMobileAds.Api;

public class BannerAd : MonoBehaviour {

   
// Use this for initialization
   
void Start () {
       
RequestBanner();
   
}
   
void RequestBanner()
   
{
       
#if UNITY_ANDROID
       
string adUnitId = "ca-app-pub-xxxxx/xxxx";
       
#elif UNITY_IPHONE
       
string adUnitId = "INSERT_IOS_BANNER_AD_UNIT_ID_HERE";
       
#else
       
string adUnitId = "unexpected_platform";
       
#endif

       
// Create a 320x50 banner at the top of the screen.
       
BannerView bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
       
// Create an empty ad request.
       
AdRequest request = new AdRequest.Builder().Build();
       
// Load the banner with the request.
        bannerView
.LoadAd(request);
     
}

   
}


Any help would be very thankful !

Vu Chau (MobileAds SDK Team)

unread,
Oct 12, 2015, 4:55:39 PM10/12/15
to Google Mobile Ads SDK Developers
Hi Kahfi,

Have you followed point # 2 found in our GitHub tutorial (under Android Setup)? Most of the times ForwardNativeEventsToDalvik is set to true in the wrong Manifest (or not in the activity tags), or overwritten with false.

Let us know if that resolves the issue,

Vu Chau
Mobile Ads SDK Team
Message has been deleted

Kahfi Alghiffari

unread,
Oct 14, 2015, 5:42:04 AM10/14/15
to Google Mobile Ads SDK Developers
Hi Vu Chau,

I have followed and made a bit changes based on the suggestion you made but it still didn't resolve the "unclickable ad problem". Somehow it did make a change which it prevents from overstacked or multiple layer ads . Is there any alternatives on resolving  "unclickable ad problem" ?

here the new code for my Assets>Plugins>Android>GoogleMobileAdsPlugin AndroidManifest.xml 
<?xml version="1.0" encoding="utf-8"?>
<!--
This Google Mobile Ads plugin library manifest will get merged with your
application's manifest, adding the necessary activity and permissions
required for displaying ads.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   
package="com.google.unity"
   
android:versionName="1.0"
   
android:versionCode="1">
 
<uses-sdk android:minSdkVersion="9"
     
android:targetSdkVersion="19" />
 
<!-- Google Mobile Ads Permissions -->
 
<uses-permission android:name="android.permission.INTERNET"/>
 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
 
<!-- Uncomment to add billing for in-app purchase ads -->
 
<!--<uses-permission android:name="com.android.vending.BILLING"/> -->
 
<application>

   
<!-- Denote the referenced Google Play services version -->
   
<meta-data android:name="com.google.android.gms.version"
       
android:value="@integer/google_play_services_version" />
   
<!-- Google Mobile Ads Activity -->

       
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity"
       
android:launchMode="singleTask"
       
android:label="@string/app_name"
       
android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen"
       
android:screenOrientation="landscape">
     
<intent-filter>
       
<action android:name="android.intent.action.MAIN" />
       
<category android:name="android.intent.category.LAUNCHER" />
     
</intent-filter>

         
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

       
</activity>

       
<activity android:name="com.google.android.gms.ads.AdActivity"    
                         
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
   
<!-- InAppPurchase Activity -->
   
<activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
       
android:theme="@style/Theme.IAPTheme"/>
 
</application>
</manifest>


Vu Chau (MobileAds SDK Team)

unread,
Oct 14, 2015, 4:51:54 PM10/14/15
to Google Mobile Ads SDK Developers
Hi Kahfi,

Have you made sure to copy the manifest found under Temp/StagingArea to Assets/Plugins/Android before setting ForwardNativeEventsToDalvik to true in the latter directory?

You could also attach and send us your APK so we can check if we see the same behavior.

Vu Chau
Mobile Ads SDK Team

Reply all
Reply to author
Forward
0 new messages