当我尝试显示 IMInterstitialAdView 时收到错误 INVALID_REQUEST。
我在真实设备上运行该应用程序,没有在测试模式下运行。我通过钛商店在我的设备上部署了该应用程序,暂时没有谷歌播放。这里的代码:
var Inmobi = require('ti.inmobi.ad');
Inmobi.setLogLevel(1);
Inmobi.sendAppTrackerConversion("dd1efdd608c7424cbd675f55d8f5a0f1");
var request = Inmobi.createIMAdRequest({
//locationInquiryAllowed : true,
// currentLocation: undefined,
testMode : false
});
var inmobiInter = Inmobi.createIMInterstitialAdView({
// activity: currentActivity,
imAppId : "dd1efdd608c7424cbd675f55d8f5a0f1"
});
var currActivity = Titanium.Android.currentActivity;
inmobiInter.load(currActivity);
// listener for onAdRequestLoaded
inmobiInter.addEventListener("onAdRequestLoaded", function() {
alert("Ad request loaded");
Ti.API.info("Ad request loaded");
});
// listener for onAdRequestFailed
inmobiInter.addEventListener("onAdRequestFailed", function(e) {
alert("Ad request failed, error Code: " + e.errorCode);
Ti.API.info("Ad request failed, error Code: " + e.errorCode);
});
// listener for onShowAdScreen
inmobiInter.addEventListener("onShowAdScreen", function() {
alert("Show Ad Screen");
Ti.API.info("Show Ad Screen");
});
// listener for onDismissAdScreen
inmobiInter.addEventListener("onDismissAdScreen", function() {
alert("Dismiss Ad screen");
Ti.API.info("Dismiss Ad screen");
});
// listener for onLeaveAdScreen
inmobiInter.addEventListener("onLeaveApplication", function() {
alert("Leave Application");
Ti.API.info("Leave Application");
});
inmobiInter.loadNewAd(request);
self.add(inmobiInter);
Ti.API.info('======================================================');
// listener
buttonMPView.addEventListener('click', function() {
Ti.API.info('------------> ' + inmobiInter.getState());
if (inmobiInter.getState() == inmobiInter.State_READY) {
inmobiInter.show();
} else {
Ti.API.info("State is not " + inmobiInter.State_READY + ", State is: "
+ inmobiInter.getState());
}
if(Titanium.Network.networkType == Titanium.Network.NETWORK_NONE){
alert("Nessuna connessione internet presente.")
}else{
self.fireEvent('clickButtonMPView')
}
});
有什么提示吗?谢谢