Firebase plugin Log predefined events Cocos creator 2.0.7

Firebase plugin Log predefined events Cocos creator 2.0.7
0

#1

If you log any event its considered as a custom event, but if i try to use predefined events from here
https://firebase.google.com/docs/reference/cpp/group/event-names

https://firebase.google.com/docs/reference/cpp/group/parameter-names#kparameterlevel

in the examples you use constants but in real code they wont work.
i want to log kEventLevelStart event with kParameterLevelName but calling throught the library returns undefined
(sdkbox.firebase.Analytics.Param.)

writing the constant value directly level_start and level_name log the event as custom event.


#2

It seems firebase updated the doc.

SDKBox use "kFIRParameterLevel = "level"; currently.

2019-02-11 11:28:20.034807+0800 hello_world-mobile[71060:46179915] [MC] Reading from private effective user settings.
JS: sdkbox.firebase.Analytics.Param
JS: level

use can use customEvent name, such as:

            const evt = {}
            evt[sdkbox.firebase.Analytics.Param.kFIRParameterItemID] = 'id123456';
            evt[sdkbox.firebase.Analytics.Param.kFIRParameterItemName] = 'name123456';
            evt[sdkbox.firebase.Analytics.Param.kFIRParameterItemCategory] = 'category123456';
            evt['customKey'] = 'custom value';
            sdkbox.firebase.Analytics.logEvent("customEvent", evt);

#3

using custom events are not shown on firebase panel unless you activate big data, but you must pay for it. That is because i wanted to use Firebase events


#4

U can define event name same as firebase’s name, it’s a string. Later I’ll update the constant .


#5

FirebaseConstant.js.zip (1.8 KB)

setup:
image

now you can use it:

console.log(sdkbox.firebase.Analytics.Event.kEventAddPaymentInfo);
JS: add_payment_info

Thanks,