Intelx XDK を使用して構築されたハイブリッド アプリ (今のところ ios) に inmobi 広告を統合するのに苦労しています。私はこのガイドに従っていました: https://www.inmobi.com/support/art/23837226/22114287/intel-partner-platform-xdk-integration-guide/ しかし、運がありませんでした. 統合は、inmobiplugin.ready イベントが発生したときにアラートを発生させる段階にさえ達しません。Intel xDK エミュレーターでテストすると、js エラーが表示されます。
Uncaught TypeError: Object [object Object] has no method 'registerLibrary' inmobiplugin.js:19
これはこれまでの私のコードで、テスト用の非常に単純なコードです。
function onMobiReady(){
alert('inmobyReady');
alertSize();
InMobiPlugin.ads.initialize({appId:'My App ID'});
InMobiPlugin.ads.initBannerAd({appId:'My App ID', adSize:'ADSIZE_320X50',top:0,left:0,refreshInterval:30,animationType:'ANIMATION_CURLUP',refTagKey:'TAGKEY',refTagValue:'TAGVALUE',keywords:'cars'});
InMobiPlugin.getNewAd(document.getElementById('home_ads'));
}
document.addEventListener("inmobiplugin.ready",onMobiReady,false);
intel xdk を使用して inmobi 広告を統合する方法の実際のコード例はありますか?
ありがとう。
編集:
これは私が使用しているコードです:
var onDeviceReady=function(){
/* This code is used to run as soon as Intel activates */
intel.xdk.device.setRotateOrientation('portrait');
intel.xdk.device.setAutoRotate(false);
document.addEventListener("inmobiplugin.ready", onReadyM, false);
};
document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);
function onReadyM()
{
alert('InMobiPlugin ready');
InMobiPlugin.ads.initialize({appId:'My APP ID'}); // Initialize to be called
// InMobi APIs can be called here
InMobiPlugin.ads.initBannerAd({appId:'My APP ID',adSize:'ADSIZE_320X50',top:200,left:0,refreshInterval:30,animationType:'ANIMATION_OFF', test:true, refTagValue:'TAGVALUE'});
InMobiPlugin.ads.setAdRequestProperties({gender:'GENDER_MALE',income:30000,education:'EDUCATION_BACHELORS_DEGREE',age:30,hasChildren:TRUE,language:'English'});
InMobiPlugin.ads.loadBannerAd();
}
「InMobi Plugin ready」というアラートが表示されます
しかし、追加はありません。テスト用の単純な html ページです。
ヒントはありますか?
どうもありがとう!