inmobi titanium module invalid_request

347 views Asked by At

I get the error INVALID_REQUEST when i try to show a IMInterstitialAdView.

I run the app on real device, no in test mode. I deployed the app on my device via titanium store, no google play for now. Here the code:

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')
    }
});

Any hint? Thank you

1

There are 1 answers

0
kapser On

I am Naresh and I work for InMobi.

You are using the older plugin and we don't recommend that.

Please use the following updated InMobi plugin for Titanium. Documentation is on the same page. It also includes InMobi analytics. http://www.inmobi.com/support/art/23846096/22114287/appcelerator-partner-platform-integration-guide/

Do let me know if you have questions.

thanks