Hi everybody, I worked hard to solve this problem, I researched all of possibilities. Heyzap, Appodeal, Mopub, etc. I encountered some problems with these mediation services. Besides tutorials are out-dated, I could not trust them. I was wondering how can I implement Admob rewarded video with custom option. Most people claimed that it is not working in Android(custom rewarded videos) In fact it is working in Android without any problem. I prepared an easy tutorial for you. After adding purchase button in UI. Do settings like in the image. Also you can declare action in rewarded video. It is not subject of this post. You can research on the internet to declare it as action(you can reward user by coins, etc.) Other thing is that, when you choose Ad network custom, it does not work in preview. Don't care! It will work on Android OS. That's it in Buildbox side! Let's go to code.. It is really easy! Go to app/src/main/java/com/buildbox/AdIntegrator.java file. Remove all code - copy & paste the code below. Code: package com.buildbox; import android.util.Log; import android.view.Gravity; import android.view.View; import android.widget.FrameLayout; import android.widget.RelativeLayout; import android.widget.Toast; import org.cocos2dx.lib.Cocos2dxActivity; import java.lang.ref.WeakReference; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdView; import com.google.android.gms.ads.InterstitialAd; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.reward.RewardedVideoAd; import com.google.android.gms.ads.MobileAds; import com.google.android.gms.ads.reward.RewardedVideoAdListener; import com.google.android.gms.ads.reward.RewardItem; public class AdIntegrator { public static native boolean rewardedVideoDidEnd(); public static RewardedVideoAd mRewardedVideoAd; public static String appId = “testads”; //put your Admob app id here. public static String rewardedAdUnitId ="ca-app-pub-3940256099942544/5224354917"; //Test ad unit ID. put your rewarded ad unit id here. private static WeakReference<Cocos2dxActivity> activity; public static void initBridge(Cocos2dxActivity act){ activity = new WeakReference<Cocos2dxActivity>(act); } public static void initAds(){ activity.get().runOnUiThread( new Runnable() { public void run() { //Admob AppID MobileAds.initialize(activity.get(),appId); //rewarded mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(activity.get()); mRewardedVideoAd.loadAd(rewardedAdUnitId, new AdRequest.Builder().build()); mRewardedVideoAd.setRewardedVideoAdListener(new RewardedVideoAdListener() { @Override public void onRewardedVideoAdClosed () { mRewardedVideoAd.loadAd(rewardedAdUnitId, new AdRequest.Builder().build()); } @Override public void onRewardedVideoAdOpened() { } @Override public void onRewardedVideoStarted() { } @Override public void onRewardedVideoCompleted() { } @Override public void onRewardedVideoAdLeftApplication() { } @Override public void onRewarded(RewardItem reward) { AdIntegrator.rewardedVideoDidEnd(); Toast.makeText(activity.get(), “Rewarded!”, Toast.LENGTH_SHORT).show(); } @Override public void onRewardedVideoAdFailedToLoad(int errorCode) { Toast.makeText(activity.get(), “No fill from Admob!“, Toast.LENGTH_SHORT).show(); } @Override public void onRewardedVideoAdLoaded() { } } ); } }); } public static boolean isRewardedVideoAvialable(){ return true; } public static void showRewardedVideo(){ activity.get().runOnUiThread( new Runnable() { public void run() { if (mRewardedVideoAd.isLoaded()) { mRewardedVideoAd.show(); } } }); } } After that, your rewarded videos should work without any problem. This code uses Admob test ads IDs so you can test it directly without any modification. If test ads working without any problem, modify appId and rewardedAdUnitId variables. Congratulations! You have successfully implemented rewarded video for Android! Note that: Admob sometimes, can not fill requests for test ads. It is admob's problem. When no fill from server you can see toast message in smartphone. I declared it in the code. Tested in Buildbox 2.3.8 #2515 I am researching to add rewarded Admob video for iOS, after if I find a solution, I will prepare another tutorial for iOS. If you have any tutorial, link, youtube video for iOS Admob Rewarded videos, please mention it. I can benefit from it.
hi forgive I did exactly as you told us the video works but the reward does not work at the end of the video bb 2.3.8 last beta
I can confirmed that this still work. And also @Forgive: this tutorial is working for iOS as well: https://www.buildbox.com/forum/inde...-custom-reward-video-to-buildbox-games.15364/ . Hope that help.
hi keven Thanks for your help, I can not open mac os files on notepad is normal? how to comfigure the file what does this function with the latest beta bb 2.3.8 ? thank you
I get the exact same '/u201c' error... I'm using Android Studio on PC, copy/pasting from notepad with BuildBox 2.3.8 B#2520 any idea what we're doing wrong? It's gotta be something simple that I'm missing... Reward Videos would change my life...
oooooh! That's sexy. Thank you. I knew it was something like that. I'm an artist not a coder, so I have lots of new challenges ahead. I appreciate your response. Hoping I can make it work. Heckers, I don't even know how to get my avatar on this forum... tells me I don't have access! LOL Thanks again, I'll wrangle this thing yet!
Yeah man, I found the problem in line 26, 65 and 69, you just changed symbol '»' by '' in there. I already tried and it works! Cheers!
Add a delay node of delay=1 between rewarded video node to the node to load checkpoint, then the app will not crash.