我只是用Unity的最后一个sdk(7.3.2)更新revmob。我正在使用Unity 4.5 Pro。除了没有显示广告外,一切似乎都运行正常。调试表示横幅广告已显示...但屏幕上没有任何内容,也没有任何内容可以点击....此外,我在游戏发布时从未获得任何Eula Popup。
我认为我没有错过任何文件(我可能会错过一些我需要你帮助的原因)。所有似乎都按照它说的设定。我没有使用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 :(得分: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的回复。