MOBILE-2957 config: Add variable to enable analytics

main
Dani Palou 2019-05-20 12:40:44 +02:00
parent 5810946b96
commit 4a913ce0ab
2 changed files with 3 additions and 2 deletions

View File

@ -80,5 +80,6 @@
"statusbarbgandroid": "#df7310", "statusbarbgandroid": "#df7310",
"statusbarlighttextandroid": true, "statusbarlighttextandroid": true,
"statusbarbgremotetheme": "#000000", "statusbarbgremotetheme": "#000000",
"statusbarlighttextremotetheme": true "statusbarlighttextremotetheme": true,
"enableanalytics": false
} }

View File

@ -303,7 +303,7 @@ export class CorePushNotificationsProvider {
logEvent(name: string, data: any, filter?: boolean): Promise<any> { logEvent(name: string, data: any, filter?: boolean): Promise<any> {
const win = <any> window; // This feature is only present in our fork of the plugin. const win = <any> 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 => { return new Promise((resolve, reject): void => {
win.PushNotification.logEvent(resolve, (error) => { win.PushNotification.logEvent(resolve, (error) => {
this.logger.error('Error logging firebase event', name, error); this.logger.error('Error logging firebase event', name, error);