SDKBOX Chartboost Reward Video issue

Chartboost in sdkbox is not updating the Reward Video ads image and text when updated on the Chartboost dashboard. After contacting chartboost, they tested the Reward Video with the updated Image and text and its working fine for them.

The problem is with sdkbox Chartboost locally. It seems to be an issue with the cache not being cleared? How do I clear the cache? or pull down the updated ads from Chartboost.

Default ads will play fine although they are the same ones over and over which is a bit odd. Again makes me think that the cache is holding an ad that it wont update from the Chartboost servers.

LOGCAT:

C:\projects\cocos2dx\shipwreck>adb logcat -s "Chartboost"
--------- beginning of system
--------- beginning of main
D/Chartboost(13611): Register Chartboost

AppDelegate.cpp

sdkbox::PluginChartboost::init();
sdkbox::PluginChartboost::setListener(new CBListener());
sdkbox::PluginChartboost::cache("Default"); // show interstitial on startup using callback
sdkbox::PluginChartboost::cache("Level Complete");

CBListener class

class CBListener : public sdkbox::ChartboostListener{
public:
	void onChartboostCached(const std::string& name)
	{
		if(name == "Default")
		{
			sdkbox::PluginChartboost::show("Default");
		}   		
	}
	bool onChartboostShouldDisplay(const std::string& name){}
	void onChartboostDisplay(const std::string& name){}
	void onChartboostDismiss(const std::string& name){}
	void onChartboostClose(const std::string& name){}
	void onChartboostClick(const std::string& name){}
	void onChartboostReward(const std::string& name, int reward){}
	void onChartboostFailedToLoad(const std::string& name, sdkbox::CB_LoadError e){}
	void onChartboostFailToRecordClick(const std::string& name, sdkbox::CB_ClickError e){}
	void onChartboostConfirmation(){}
	void onChartboostCompleteStore(){}
};

HelloWorld.cpp

// Calling ad on button press Start
sdkbox::PluginChartboost::show("Level Complete"); // Offer reward

And changing the name of the ad in .sdkbox_package.json from Level Complete to Level Started and updating the code where appropriate displays a normal Default ad, with logcat ouput:

LOGCAT:

C:\projects\cocos2dx\shipwreck>adb logcat -s "Chartboost"
--------- beginning of system
--------- beginning of main
D/Chartboost(18087): Register Chartboost
I/Chartboost(18087): Trying to find unknown ad: Level Started.
I/Chartboost(18087): Failed to find ad with name: Level Started showing Interstitial by default

I have updated SDKBOX with sdkbox update and it did give some failed to update errors. After a second attempt at updating sdkbox it gives:

C:\projects\cocos2dx\shipwreck>sdkbox update
  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2015 SDKBOX Inc. v1.0.0.9
 2.1.2.6 2.1.2.6
 failed to update package ios
 2.1.2.6 2.1.2.6
 2.1.2.6 2.1.2.6
 failed to update package android
 failed to update package Chartboost
 all packages are up to date.

Checking the .json config file it shows the version being used is 2.1.2.6.

"chartboost": {
    "engine": "3", 
    "name": "chartboost", 
    "args": {
        "patcherrors": 0, 
        "forcedownload": 0, 
        "noupdate": 0, 
        "days": 10, 
        "remote": 0, 
        "verbose": 0, 
        "forcecopy": 1, 
        "command": "update", 
        "nohelp": 0, 
        "server": "download.sdkbox.com/installer/v1/", 
        "manifest": "manifest.json", 
        "project": "./", 
        "china": 0, 
        "alwaysupdate": 0, 
        "installer": "C:/development/sdkbox_installer/sdkbox.pyc", 
        "nopatchingcpp": 0, 
        "local": 0, 
        "nopatching": 1, 
        "jsonapi": 0
    }, 
    "version": [
        2, 
        1, 
        2, 
        6
    ], 
    "result": "ok", 
    "message": "success", 
    "constants": {
        "ANDROID_STUDIO_JNI_DIR": "proj.android-studio/app/jni/", 
        "COCOS_BACKUP_DIR": "backup-2016-03-23-2/", 
        "COCOS_PROJECT_DIR": "./", 
        "COCOS_2DX_INSTALLATION_VERSION": "3.10.0", 
        "ANDROID_COCOS_PACKAGE_ROOT": "cocos2d/cocos/platform/android/java/", 
        "ANDROID_STUDIO_ACTIVITY_NAME": "AppActivity", 
        "SDKBOX_PLUGIN_NAME": "Chartboost", 
        "ANDROID_STUDIO_PROJECT_DIR": "proj.android-studio/", 
        "COCOS_PROJECT_HINT": "./", 
        "SDKBOX_DIR": "C:/Users/David/.sdkbox/", 
        "ANDROID_STUDIO_PROPERTIES": "proj.android-studio/app/project.properties", 
        "COCOS_ENGINE_TYPE": "unknown", 
        "ANDROID_PROJECT_DIR": "proj.android/", 
        "ANDROID_COCOS_SRC_DIR": "cocos2d/cocos/platform/android/java/src/org/cocos2dx/lib/", 
        "COCOS_CLASSES_DIR": "Classes/", 
        "XCODE_PROJECT": "proj.ios_mac/project.pbxproj/", 
        "ANDROID_STUDIO_ACTIVITY_PATH": "proj.android-studio/app/src/org/cocos2dx/cpp/", 
        "ANDROID_SDK_DIR": "C:/development/android/sdk/", 
        "COCOS_2DX_ROOT": "C:/development/cocos2d-x/cocos2d-x-3.10/", 
        "ANDROID_MANIFEST": "proj.android/AndroidManifest.xml", 
        "ANDROID_STUDIO_MANIFEST": "proj.android-studio/app/AndroidManifest.xml", 
        "ANDROID_JNI_DIR": "proj.android/jni/", 
        "ANDROID_ACTIVITY_NAME": "AppActivity", 
        "IOS_PROJECT_DIR": "proj.ios_mac/", 
        "ANDROID_STUDIO_MK": "proj.android-studio/app/jni/Android.mk", 
        "XCODE_PROJECT_DIR": "proj.ios_mac/", 
        "COCOS_2DX_VERSION": "3.10.0", 
        "ANDROID_PROPERTIES": "proj.android/project.properties", 
        "ANDROID_ACTIVITY_PATH": "proj.android/src/org/cocos2dx/cpp/", 
        "ANDROID_MK": "proj.android/jni/Android.mk", 
        "ANDROID_STUDIO_LIBS_DIR": "cocos2d/cocos/platform/android/libcocos2dx/libs/", 
        "ANDROID_LIBS_DIR": "cocos2d/cocos/platform/android/java/libs/", 
        "COCOS_RESOURCES_DIR": "Resources/", 
        "APPLICATION_MK": "proj.android/jni/Application.mk"
    }
},

Chartboost config, signature and id removed

"Chartboost": {
    "signature": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 
    "ads": {
        "Default": {
            "type": "interstitial"
        }, 
        "Level Started": {
            "type": "rewarded_video"
        }, 
        "MoreApp": {
            "type": "more_app"
        }
    }, 
    "id": "XXXXXXXXXXXXXXXXXXXXXXXXXX"
}

I don’t think you need to clear the cache yourself, chartboost will take care of that. You have to make sure your chartboost app is not in testing mode. Also you have to double check your configuration, the correct configuration file for sdkbox is sdkbox_config.json

So should I rename the .json file? The sample shows that its correct.

https://github.com/sdkbox/sdkbox-admob-sample/tree/master/cpp

The .sdkbox_package.json file is being read because If I change the name of the ad from Level Complete to Level Started logcat shows it’s trying to find it but fails.

It’s definitely not in testing mode because there are ads from Candy Crush being displayed. Testing mode dosent work because Chartboost locally is not updating properly.

UPDATE:

Updating the sdkbox_config.json file in the Resources directory of the android project does the trick. Very confusing that there are 2 configuration files.

Sorry about the confusion we’ll update the documentation to make it more clear.

i don’t get anything
all the documents for the chartboost are old
i can’t even got how to extend the sdkbox
this is ridiculous and very poor documentations
my mind is just crashed in this , all the things i try but can’t got ad
this is very rediculous

That would help, there also seems to be config information about abmob and chartboost in both files, which is why I got confused about the correct one to update. Also updating the wrong file still registers with logcat showing that it cant find the correct ad by its name.

From the error log it looks like the callback function haven’t been implemented yet, can you double check?

Here is a sample of implementation
https://github.com/sdkbox/sdkbox-chartboost-sample/blob/master/cpp/Classes/HelloWorldScene.cpp#L90

yehh
got it
thanks!!!

1 Like