flurryAnalytics.init()

Type Function
Return value none
Revision Release 2024.3703
Keywords analytics, Flurry Analytics, init
See also flurryAnalytics.*

Overview

This function initializes the Flurry plugin and it must be executed before making other Flurry calls such as flurryAnalytics.logEvent().

Important

You must wait for the "init" phase event before trying to log analytics events (flurryAnalytics.logEvent()) or start timed events (flurryAnalytics.startTimedEvent()).

Syntax

flurryAnalytics.init( listener, params )
listener (required)

Listener. Listener that will receive analyticsRequest events.

params (required)

Table. Table containing Flurry initialization values — see the next section for details.

Parameter Reference

The params table includes parameters for the Flurry initialization.

apiKey (required)

String. Your Flurry API key, gathered from the Flurry system.

crashReportingEnabled (optional)

Boolean. Set to true to enable crash analytics. This will enable your app to send crash data and unhandled errors to Flurry. Default is false.

logLevel (optional)

String. Sets the logging level. Default is minimal logging with critical messages only. Possible values include "default", "debug", or "all".

Example

local flurryAnalytics = require( "plugin.flurry.analytics" )

local function flurryListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.provider )
    end
end

-- Initialize the Flurry plugin
flurryAnalytics.init( flurryListener, { apiKey="YOUR_API_KEY" } )