2014-07-23 195 views
0

我剛剛更新revmob與Unity的最後sdk(7.3.2)。我正在使用Unity 4.5 Pro。除了不顯示廣告之外,一切似乎都很好。調試說,橫幅廣告顯示......但屏幕上沒有任何東西可以點擊......另外,我也沒有在遊戲發佈時獲得任何Eula Popup。RevMob沒有廣告顯示

我認爲我沒有錯過任何文件(我可能錯過了這是爲什麼我需要你的幫助)。似乎都像它說的那樣設置。我沒有使用Proguard,所以我沒有執行googleplayservice proguard步驟。

這裏的清單:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:theme="@android:style/Theme.NoTitleBar" android:versionCode="1" android:versionName="1.0" package="com.bas.revmobtesting" android:installLocation="preferExternal"> 
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" /> 
    <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false"> 
    <activity android:label="@string/app_name" android:name="com.bas.revmobtesting.UnityPlayerNativeActivity" android:screenOrientation="portrait" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale"> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
     <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> 
     <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> 
    </activity> 
    <activity android:configChanges="keyboardHidden|orientation" android:name="com.revmob.ads.fullscreen.FullscreenActivity" android:theme="@android:style/Theme.Translucent"> 
    </activity> 
    <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> 
    </application> 
    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="20" /> 
    <uses-feature android:glEsVersion="0x00020000" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
</manifest> 

這裏的簡單腳本:提前

public class RevMobTesting : MonoBehaviour, IRevMobListener 
{ 
     private static readonly Dictionary<String, String> REVMOB_APP_IDS = new Dictionary<String, String>() { 
     { "Android", "My_ANDROID_ID"}, 
     { "IOS", "My_IOS_ID" } 
    }; 
     private RevMob revmob; 

     void Awake() 
     { 
       revmob = RevMob.Start (REVMOB_APP_IDS, gameObject.name); 
       revmob.SetTestingMode (RevMob.Test.WITH_ADS); 
       revmob.PrintEnvironmentInformation(); 
     } 

     private void Start() 
     { 
       #if UNITY_ANDROID || UNITY_IPHONE 
       RevMobBanner banner = revmob.CreateBanner(); 
       banner.Show(); 
       #endif 
     } 

    #region IRevMobListener implementation 
     public void SessionIsStarted() 
     { 
       Debug.Log ("Session started."); 
     } 

     public void SessionNotStarted (string revMobAdType) 
     { 
       Debug.Log ("Session not started."); 
     } 

     public void AdDidReceive (string revMobAdType) 
     { 
       Debug.Log ("Ad did receive."); 
     } 

     public void AdDidFail (string revMobAdType) 
     { 
       Debug.Log ("Ad did fail."); 
     } 

     public void AdDisplayed (string revMobAdType) 
     { 
       Debug.Log ("Ad displayed."); 
     } 

     public void UserClickedInTheAd (string revMobAdType) 
     { 
       Debug.Log ("Ad clicked."); 
     } 

     public void UserClosedTheAd (string revMobAdType) 
     { 
       Debug.Log ("Ad closed."); 
     } 

     public void InstallDidReceive (string message) 
     { 
       Debug.Log ("Install received"); 
     } 

     public void InstallDidFail (string message) 
     { 
       Debug.Log ("Install not received"); 
     } 

     public void EulaIsShown() 
     { 
       Debug.Log ("Eula is displayed"); 
     } 

     public void EulaAccepted() 
     { 
       Debug.Log ("Eula was accepted"); 
     } 

     public void EulaRejected() 
     { 
       Debug.Log ("Eula was rejected"); 
     } 
    #endregion 
} 

謝謝, 大衛

+0

好吧,經過幾次測試,似乎全屏廣告正在工作,但如果我使用橫幅,它不會顯示出來......而我從來沒有得到EULA彈出窗口... –

+0

最後,唯一的問題是橫幅。聯繫revmob後,EULA彈出窗口將不顯示,直到他們決定。等待關於橫幅問題的新聞:) –

回答

1

不知道你解決問題或沒有。升級到7.3.2時遇到同樣的問題。我曾用這條線創建橫幅:

banner = revmob.CreateBanner(RevMob.Position.BOTTOM); 

在7.3.2中,「AdDisplayed」事件觸發,但沒有顯示橫幅。最後,我成功召喚了這樣的代碼:

int bannerWidth = (int) Screen.width; 
cost float bannerRatio = 6.4f; 
int bannerHeight = (int) (Screen.width/bannerRatio); 
banner = revmob.CreateBanner(RevMob.Position.TOP, 
          0, (int)(Screen.height - bannerHeight), 
          bannerWidth, bannerHeight); 

看起來Position.BOTTOM在7.3.2中不起作用。我也在等RevMob的回覆。

+0

現在無法測試它,因爲我沒有更多關於該項目的內容,但是如果你發現了這種方式並且它能夠工作,謝謝。我會盡快測試! –