How to use Flurry in Cocos 3.7 JS project

Cocos Helper (JavaScript)
  • efares
    Likes 0

    Problem Description

    Hi,

    I followed both instructions SDKBOX installer and Cocos Helper (JavaScript) and then followed the instructions to install Flurry Analytics and looked at Flurry sample but I'm still having some trouble getting the Flurry plugin to work and I have some questions on how to use Flurry.

    1. I am getting a "Uncaught ReferenceError: sdkbox is not defined" Any idea on how to fix this?
    2. Where am I supposed to put all of this code:
    // Flurry Analytics
    this.session_created = false
    var self = this
        // Flurry Event Listener
    sdkbox.PluginFlurryAnalytics.setListener({
        flurrySessionDidCreateWithInfo: function (info) {
            self.session_created = true
            var jsonInfo = JSON.parse(info)
            console.log("Menu session started")
            console.log("APIKey :" + jsonInfo.apiKey + " session id :" + jsonInfo.sessionId);
            sdkbox.PluginFlurryAnalytics.logEvent("Log menu session", JSON.stringify({
                "eKey1": "eVal1",
                "eKey2": "eVal2"
            }));
        }
    });
    sdkbox.PluginFlurryAnalytics.init(); // Initialize Flurry Analytics
    sdkbox.PluginFlurryAnalytics.startSession(); // Start a Flurry session
    sdkbox.PluginFlurryAnalytics.setCrashReportingEnabled(true); // Enable crash reports by Flurry
    sdkbox.PluginFlurryAnalytics.logPageView(); // Track a page view during session

    I have put it in my app.js file in

    ctor: function() {

     is this the right spot? And am I supposed to do this for every page of my app? i.e. menu scene and again in play scene?

    Thanks!

  • Sonar Systems admin
    Likes 1

    For SDKBOX I would recommend asking the Cocos2d-x forums but the helper will be supporting Flurry soon.

     

Login to reply