Fix issues with Analytics

This commit is contained in:
Chris Bianca 2017-03-10 14:43:09 +00:00
parent b343a46de0
commit eab45d7dc8
2 changed files with 4 additions and 5 deletions

View File

@ -34,18 +34,17 @@ RCT_EXPORT_METHOD(setCurrentScreen:(NSString *) screenName
[FIRAnalytics setScreenName:screenName screenClass:screenClassOverriew];
}
RCT_EXPORT_METHOD(setMinimumSessionDuration:(NSNumber *) milliseconds)
RCT_EXPORT_METHOD(setMinimumSessionDuration:(nonnull NSNumber *) milliseconds)
{
//Not implemented on iOS
}
RCT_EXPORT_METHOD(setSessionTimeoutDuration:(NSNumber *) milliseconds)
RCT_EXPORT_METHOD(setSessionTimeoutDuration:(nonnull NSNumber *) milliseconds)
{
//Not implemented on iOS
}
RCT_EXPORT_METHOD(setUserId: (NSString *) id
props:(NSDictionary *) props)
RCT_EXPORT_METHOD(setUserId: (NSString *) id)
{
[FIRAnalytics setUserID:id];
}

View File

@ -28,7 +28,7 @@ export default class Analytics extends Base {
* @param params
* @return {Promise}
*/
logEvent(name: string, params: Object): void {
logEvent(name: string, params: Object = {}): void {
// check name is not a reserved event name
if (ReservedEventNames.includes(name)) {
throw new Error(`event name '${name}' is a reserved event name and can not be used.`);