[SOLVED] ReferenceError: sdkbox is not defined

[SOLVED] ReferenceError: sdkbox is not defined
0.0 0


I don’t fully understand what is going on in app.js in the sample.
Would you be able to explain to me what the code is doing in terms of setting up Flurry?

Much appreciated.


Yea that’s expected, since we sdkbox don’t support web yet.


so for flurry if you want to log event

for example, if you want to track what player is purchasing

sdkbox.PluginFlurryAnalytics.logEvent("purchase", JSON.stringify({"item":"remove_ad", "cost":"1000"}));


Right, OK.

I’m looking at the Flurry Sample and I keep seeing this message in the log for iOS but not on Android:

Flurry: startSession has been called already. It should only be called once. Returning.

Am I supposed to use both sdkbox.PluginFlurryAnalytics.init(); and sdkbox.PluginFlurryAnalytics.startSession(); in app.js and in my other scenes?
Then within my code: sdkbox.PluginFlurryAnalytics.logEvent("User did something...");
And then onExit I use sdkbox.PluginFlurryAnalytics.endSession(); ?

Is this syntax right?
Thanks again for your help and @pabitrapadhy

PS. 2 questions:

  1. Is this the right way to set the gender: sdkbox.PluginFlurryAnalytics.setGender("male");
  2. If a scene has multiple layers in it added as Childs then should I start a session in each layer?


You only need to call startSeesion when your game starts. not every scene.


There is nowhere to say web not supported. Should add this to the documentation.


This solved the same issue I with the Facebook and Share plugins for cocos2d-x-3.9, the is at <game_folder>/frameworks/runtime-src/Classes/js_module_register.h

#include "PluginShareJS.hpp"
#include "PluginShareJSHelper.h"
#include "PluginFacebookJS.hpp"
#include "PluginFacebookJSHelper.h"

int js_module_register()
    // SDKBOX


I’m facing the same issue now… Any luck?