From 4a913ce0ab80dff02c94cce2aa94545dac2c9549 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 20 May 2019 12:40:44 +0200 Subject: [PATCH] MOBILE-2957 config: Add variable to enable analytics --- src/config.json | 3 ++- src/core/pushnotifications/providers/pushnotifications.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.json b/src/config.json index cd7c0fd99..57216340b 100644 --- a/src/config.json +++ b/src/config.json @@ -80,5 +80,6 @@ "statusbarbgandroid": "#df7310", "statusbarlighttextandroid": true, "statusbarbgremotetheme": "#000000", - "statusbarlighttextremotetheme": true + "statusbarlighttextremotetheme": true, + "enableanalytics": false } diff --git a/src/core/pushnotifications/providers/pushnotifications.ts b/src/core/pushnotifications/providers/pushnotifications.ts index 28de7b014..3a48abfc7 100644 --- a/src/core/pushnotifications/providers/pushnotifications.ts +++ b/src/core/pushnotifications/providers/pushnotifications.ts @@ -303,7 +303,7 @@ export class CorePushNotificationsProvider { logEvent(name: string, data: any, filter?: boolean): Promise { const win = window; // This feature is only present in our fork of the plugin. - if (win.PushNotification && win.PushNotification.logEvent) { + if (CoreConfigConstants.enableanalytics && win.PushNotification && win.PushNotification.logEvent) { return new Promise((resolve, reject): void => { win.PushNotification.logEvent(resolve, (error) => { this.logger.error('Error logging firebase event', name, error);