[SOLVED] ReferenceError: sdkbox is not defined

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.

1 Like

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.

1 Like

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

1 Like

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

//...
#ifdef SDKBOX_ENABLED
#include "PluginShareJS.hpp"
#include "PluginShareJSHelper.h"
#endif
#ifdef SDKBOX_ENABLED
#include "PluginFacebookJS.hpp"
#include "PluginFacebookJSHelper.h"
#endif

USING_NS_CC;
int js_module_register()
{
    //...
    // SDKBOX
    sc->addRegisterCallback(register_all_PluginShareJS);
    sc->addRegisterCallback(register_all_PluginShareJS_helper);
    sc->addRegisterCallback(register_all_PluginFacebookJS);
    sc->addRegisterCallback(register_all_PluginFacebookJS_helper);
}

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