大家好,我需要一些帮助来实施奖励视频听众。除了使用插件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 :(!!!!