SDKBOX AdMob banner ad size

Specific thread for this problem

Updated sdkbox update didnt work giving errors.

Downloaded the installer again and it seems to be working fine now. Ill check AdMob as soon as its updated.

EDIT:

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 they are all using 2.1.2.6

"admob": {
    "engine": "3", 
    "name": "admob", 
    "args": {
        "patcherrors": 0, 
        "project": "./", 
        "noupdate": 0, 
        "nopatchingcpp": 0, 
        "remote": 0, 
        "verbose": 0, 
        "forcecopy": 1, 
        "nohelp": 0, 
        "days": 10, 
        "server": "download.sdkbox.com/installer/v1/", 
        "forcedownload": 0, 
        "command": "update", 
        "installer": "C:/development/sdkbox_installer/sdkbox.pyc", 
        "alwaysupdate": 0, 
        "china": 0, 
        "manifest": "manifest.json", 
        "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_2DX_VERSION": "3.10.0", 
        "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": "AdMob", 
        "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_BACKUP_DIR": "backup-2016-03-23-2/", 
        "ANDROID_PROPERTIES": "proj.android/project.properties", 
        "ANDROID_ACTIVITY_PATH": "proj.android/src/org/cocos2dx/cpp/", 
        "COCOS_RESOURCES_DIR": "Resources/", 
        "ANDROID_STUDIO_LIBS_DIR": "cocos2d/cocos/platform/android/libcocos2dx/libs/", 
        "ANDROID_LIBS_DIR": "cocos2d/cocos/platform/android/java/libs/", 
        "ANDROID_MK": "proj.android/jni/Android.mk", 
        "APPLICATION_MK": "proj.android/jni/Application.mk"
    }
}, 

UPDATE:

The .sdk_packages.json file looks like this for the admob ad on android. Obviously the ca-app-pub-XX contains the correct values.

"android": {
        "AdMob": {
            "ads": {
                "gameover": {
                    "type": "interstitial", 
                    "id": "ca-app-pub-XXXXXXXXXXXXXXXXXXXXX"
                }, 
                "home": {
                    "width": 320, 
                    "type": "banner", 
                    "id": "ca-app-pub-XXXXXXXXXXXXXXXXXXXXX", 
                    "alignment": "bottom", 
                    "height": 50
                }
            }
        }
    }, 

This is the result.

Im also having issues with the Chartboost sdkbox implementation for ads, the cache is not being cleared when the app is closed or even uninstalled. I have updated the reward video image and text on the Chartboost dashboard but the app still displays the old image and text.

I have contacted Chartboost and theyre tests show that the ad is being updated, but sdkbox Chartboost in my app is not pulling the updated ad.

The problem for both AdMob and Chartboost in sdkbox seems to be the cache because they are not loading the updated ads or reading the .json file for dimensions. Another example in AdMob is if I change the name from home to bannerad, and update the code accordingly, nothing is being displayed.

CODE:

AppDelegate.cpp

sdkbox::PluginAdMob::init();
sdkbox::PluginAdMob::setListener(new IMListener());
sdkbox::PluginAdMob::setTestDevices("XXXXXXXXXXXXXXXXXXXXXXXXX");
sdkbox::PluginAdMob::cache("home");
//sdkbox::PluginAdMob::cache("gameover");

IMListener

class IMListener : public sdkbox::AdMobListener{
public:
    virtual void adViewDidReceiveAd(const std::string &name) {
    	if(name == "home")
    	{
    		sdkbox::PluginAdMob::show(name);
    	}
    }
    virtual void adViewDidFailToReceiveAdWithError(const std::string &name, const std::string &msg) {
    }
    virtual void adViewWillPresentScreen(const std::string &name) {
    }
    virtual void adViewDidDismissScreen(const std::string &name) {
    }
    virtual void adViewWillDismissScreen(const std::string &name) {
    }
    virtual void adViewWillLeaveApplication(const std::string &name) {
    }
};

HelloWorld.cpp

bool HelloWorld::init(){

    // do stuff here

    sdkbox::PluginAdMob::show("home");

    return true;
}

LOGCAT:

C:\projects\cocos2dx\shipwreck>adb logcat -s "AdMob"
--------- beginning of system
--------- beginning of main
D/AdMob   ( 7057): cache ad home
D/AdMob   ( 7057): ad home is available ?false
D/AdMob   ( 7057): cache ad gameover
D/AdMob   ( 7057): ad gameover is available ?false
D/AdMob   ( 7057): cache ad home
D/AdMob   ( 7057): ad home is available ?false
D/AdMob   ( 7057): ad home is available ?false
D/AdMob   ( 7057): Interstitial onAdLoaded
D/AdMob   ( 7057): onAdLoaded
D/AdMob   ( 7057): ad home is available ?true
D/AdMob   ( 7057): ad home is available ?true

UPDATE:

There are 2 sdkbox configuration files. One in the root directory called .sdkbox_packages.json and another in the Resources directory called .sdkbox_config.json. Both have admob/chartboost configuration details in them. Updating the .sdkbox_config.json file solves the issues. This should be in the documentation somewhere.

Hello @damort

.sdkbox_packages.json is a file that contains info about the sdkbox plugin packages you are using inside of your project.

whereas sdkbox_config.json file contains the config of the plugins that you have added to your project.
you only need to make necessary changes to all the configs file for all the plugins.

I believe, it’s there in the documentation for all our plugins, as you could see here -
http://docs.sdkbox.com/en/plugins/admob/v3-cpp/#json-configuration

as we haven’t mentioned any change for the sdkbox_packages.json file, only changes in the config file will do the job. :smile:

But thanks anyway for bringing this to us.
we surely hope to improve our documentation.

Best,
Pabitra

Both .sdkbox_packages.json and sdkbox_config.json contain:

"android": {
        "AdMob": {
            "ads": {
                "gameover": {
                    "type": "interstitial", 
                    "id": "ca-app-pub-XXXXXXXXXXXXXXXXXXXXX"
                }, 
                "home": {
                    "width": 320, 
                    "type": "banner", 
                    "id": "ca-app-pub-XXXXXXXXXXXXXXXXXXXXX", 
                    "alignment": "bottom", 
                    "height": 50
                }
            }
        }
    },

For people having the same headache as I had, only udpate sdkbox_config.json :smile:

Really cool system btw guys it makes everything really easy, thanks for making it! PS add GPS Multiplayer :blush: