Skip to content

Commit

Permalink
fix(analytics): logEvent params can be objects, further fix for… (#3351)
Browse files Browse the repository at this point in the history
* fix(analytics): pass logEvent params as-is broken in #3219
* fix(types,analytics): logEvent types for #3219
* refactor(types,analytics): simplify logEvent type
  • Loading branch information
plaa committed Apr 3, 2020
1 parent 7351147 commit eebfb04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 0 additions & 10 deletions packages/analytics/lib/index.js
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/analytics/lib/index.js.flow
Expand Up @@ -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.
Expand Down

0 comments on commit eebfb04

Please sign in to comment.