defold / extension-firebase-analytics

Google Firebase Analytics extension for the Defold game engine
https://www.defold.com/extension-firebase-analytics/
MIT License
16 stars 12 forks source link

init() doesn't call callback #20

Closed dri-richard closed 3 years ago

dri-richard commented 3 years ago

Using: Defold 1.2.184 Extension-firebase 1.1.3 Extension-firebase-analytics 2.0.2

Platform: Android

Description firebase.analytics.init doesn't appear to call the supplied callback after initialisation. I know that initialisation has been successful, because I see events in the Google Analytics DebugView.

This source code:

local function init_callback(self, ok, err)
    print("in init_callback")
    if ok then
        print("ok")
    end
    if err then
        print("err")
    end
    if not ok then
        print("Firebase Analytics initialisation error")
        print(err)
        return
    end
    print("Firebase analytics initialised")
end

local function init_firebase(self)
    print("About to check for firebase")
    if not firebase then
        print("firebase doesn't exist")
        return
    end
    print("About to init firebase")
    local ok, err = firebase.init()
    if not ok then
        print("Firebase initialisation error")
        print(err)
        return
    end
    print("About to init firebase analytics")
    -- initialise analytics
    firebase.analytics.init(init_callback)
    print("init_firebase complete")
end

produces this output in logcat:

DEBUG:SCRIPT: About to check for firebase
DEBUG:SCRIPT: About to init firebase
DEBUG:SCRIPT: About to init firebase analytics
DEBUG:SCRIPT: init_firebase complete
britzl commented 3 years ago

Not sure why there's no callback for analytics.init(). There's no code for this at all...

dri-richard commented 3 years ago

Could the usage in the manual be amended until/unless callback code is added?