espace

need help to integrate charboost videoreward with cocoon

Recommended Posts

hi,

i would like to integrate charboost videoreward in my app. I success with admob and mopub (interstitial and banner) but with video i don't.

i have follow this documentation on cocoon and the example api:
https://docs.cocoon.io/article/cocoon-chartboost-plugin/#Rewarded_videos

https://github.com/CocoonIO/cocoon-template-ads

here is the list of the plugins activated in cocoon:

  • AdMob native Ads for Android
  • cocoon-plugin-ads-android-admob
  • Ios
  • com.ludei.canvasplus.ios
  • Android
  • com.ludei.canvasplus.android 3.2.6
  •  
  • Splashscreen
  • com.peerio.cordova.plugin.splashscreen
  • 1.0.5
  •  
  • Chartboost native Ads for Android
  • cocoon-plugin-ads-android-chartboost
  • 1.0.1
  •  
  • ChartBoost adapter for AdMob Android
  • cocoon-plugin-ads-android-admob-chartboost

and finally below my code.

I receive no error when i invoke createInterstitial()  but the video don't begin (on wifi and 3g):

on the cocoon forum no help, it's frustating .... thanks for your help :°)

    var createInterstitial=function(){
    		if( navigator.userAgent.match(/Android/i)
    			|| navigator.userAgent.match(/webOS/i)
    			|| navigator.userAgent.match(/iPhone/i)
    			|| navigator.userAgent.match(/iPad/i)
    			|| navigator.userAgent.match(/iPod/i)
    			|| navigator.userAgent.match(/BlackBerry/i)
    			|| navigator.userAgent.match(/Windows Phone/i)
    		){
    			adService = Cocoon.Ad.Chartboostg)
    				
    			adService.configure({
    				ios: {
    					appId:"4ed254a3cb5015e47c000000",
    					appSignature:"91858cc162b56414ca47e63ce7a1b20105c70e65"
    				},
    				android: {
    					appId:"50ae12d715ba47c00d01000c",
    					appSignature:"95fb313c08717042903819d76f65d64d2347ac44"
    	}
    			});
    			interstitial = adService.createRewardedVideo();
    			//interstitial = adService.createInterstitial();

    			interstitial.on("load", function(){
    				console.log("Interstitial loaded");
    			});
    			interstitial.on("fail", function(){
    				console.log("Interstitial failed");
    			});
    			interstitial.on("show", function(){
    				console.log("Interstitial shown");
    			});
    			interstitial.on("dismiss", function(){
    				console.log("Interstitial dismissed");
    			});

    			interstitial.on("click", function(){
    				alert("click")
    				console.log("Interstitial dismissed");
    				if(level_number < 19){
    					this.game.state.start("level"+level_number+1);
    				}
    			});
    			interstitial.on("reward", function(){
    				alert("reward")
    				console.log("Interstitial dismissed");
    				if(level_number < 19){
    					this.game.state.start("level"+level_number+1);
    				}
    			});

    			interstitial.load()
    			
    			interstitial.show()
    		}
    	}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.