【发布时间】:2018-08-29 15:03:04
【问题描述】:
大家好,我需要一些帮助来实施奖励视频听众。 除了使用插件https://github.com/floatinghotpot/cordova-admob-pro.git
,我还有一个基本的 admob 设置所以简单来说,我需要在观看视频后奖励我的玩家,我该怎么做?
//this is my admob.js///////////////////////////////////////////////////////
var admobid = {};
if( /(android)/i.test(navigator.userAgent) ) {
admobid = { // for Android
banner: '',
interstitial: '',
rewardvideo: 'my code etc',
};
} else if(/(ipod|iphone|ipad)/i.test(navigator.userAgent)) {
admobid = { // for iOS
banner: '',
interstitial: '',
rewardvideo: 'my code etc',
};
} else {
admobid = { // for Windows Phone
banner: '',
interstitial: '',
};
}
if (AdMob) AdMob.createBanner( {
adId: admobid.banner,
isTesting: false,
overlap: true,
offsetTopBar: false,
position: AdMob.AD_POSITION.BOTTOM_CENTER,
bgColor: 'black'
});
if (AdMob) AdMob.prepareInterstitial( {adId:admobid.interstitial, autoShow:false} );
if (AdMob) AdMob.prepareRewardVideoAd({ adId:admobid.rewardvideo, autoShow:false} );
/////////////////////////////////////// ////////////////////////////bellow是我游戏中使用的一个简单函数
///now with this I do my reward video call in a function in my game
///this bellow gets called when a button is hit and launches the reward
///video
freecoinsss:function()
{
if (AdMob) AdMob.showRewardVideoAd();
},
现在我的问题是如何让事件监听器具有奖励我的玩家观看视频的功能 "这是我要调用奖励玩家的函数" rewardforvideo(); 顺便说一句,在移相器中编码
rewardforvideo:function()
{
var reward = 50;
var cash = localstorage.getItem('money');
var newcash = (reward+cash);
localstorage.setItem('money',newcash)
},
我找到了这个https://developers.google.com/admob/android/rewarded-video-adapters 但我坚持实施它Helppppppp :(!!!!
【问题讨论】:
标签: javascript admob phaser-framework rewardedvideoad cordova-admob