fix(analytics): logEvent params can be objects, further fix for… (#3351)

* fix(analytics): pass logEvent params as-is broken in #3219
* fix(types,analytics): logEvent types for #3219
* refactor(types,analytics): simplify logEvent type
This commit is contained in:
Sampo Juustila
2020-04-03 16:26:56 +03:00
committed by GitHub
parent 73511472bd
commit eebfb04a7c
2 changed files with 1 additions and 11 deletions

View File

@@ -90,16 +90,6 @@ class FirebaseAnalyticsModule extends FirebaseModule {
);
}
const entries = Object.entries(params);
for (let i = 0; i < entries.length; i++) {
const [key, value] = entries[i];
if (isObject(value) || isArray(value)) {
params[key] = value.toString();
}
}
return this.native.logEvent(name, params);
}

View File

@@ -623,7 +623,7 @@ export interface Module extends ReactNativeFirebaseModule {
* @param name Event name must not conflict with any Reserved Events. 100 characters is the maximum length for param key names.
* @param params Parameters to be sent and displayed with the event.
*/
logEvent(name: string, params?: { [key: string]: string | number | boolean } | {}): Promise<void>;
logEvent(name: string, params?: { [key: string]: any }): Promise<void>;
/**
* If true, allows the device to collect analytical data and send it to Firebase.