mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 22:50:20 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user