Admob Rewarded Videos

SLotman

Active member
3rd Party Module Dev
Joined
Jul 3, 2017
Messages
149
So, I've got a skeleton of a module, implementing Admob rewarded video ads (on top of the old interstitial module). It shows the test ad, and it receives the message with "10 coins" (the standard reward AFAIK)

My question is: is there any way I can make a callback from Java to Monkey? Something like this:

'AdmobRewards.monkey
Class AdmobRewards Extends Null = "AdmobRewards"
Method ShowAd:Void(myFunction)
End Class

'AdmobRewards.java
class AdmobRewards implements Runnable{
public void ShowAd( myFunction) { _callback = myFunction; }
static public void registerReward(RewardItem reward) { _callback(reward); }
}

So far I'm just storing those values on variables and passing them to Monkey with 'getRewardType' and 'getRewardAmmount' - but this is a hack job, would be nice to be able to just have a 'rewardReceived' abstract method or something available in Monkey to be used.
 

Rich

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Sep 9, 2017
Messages
451
I think there is a way. I've not done it myself, if you look at brl.cerberusstore, there maybe some pointers in there
 

SLotman

Active member
3rd Party Module Dev
Joined
Jul 3, 2017
Messages
149
Yikes, I'm looking at it and its waaay beyond me :p

On the monkey/cerberus side it implements async events and an interface... and I don't understand yet how that connects with the java source :(
 

Rich

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Sep 9, 2017
Messages
451
I might take a look this weekend. I too got a basic rewards ad working, but failed to do any async. Maybe better luck this time ;-)
 
Top Bottom