From b2cf777bec7f0637dafa8a5dc76aee0a70a6afae Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 8 Apr 2019 12:28:02 +0200 Subject: [PATCH] MOBILE-2947 notification: Apply color to small icon --- src/config.json | 3 ++- src/core/pushnotifications/providers/pushnotifications.ts | 3 ++- src/providers/local-notifications.ts | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/config.json b/src/config.json index 0c50767de..25d51bc90 100644 --- a/src/config.json +++ b/src/config.json @@ -70,5 +70,6 @@ "multisitesdisplay": "", "skipssoconfirmation": false, "forcedefaultlanguage": false, - "privacypolicy": "https:\/\/moodle.org\/mod\/page\/view.php?id=8148" + "privacypolicy": "https:\/\/moodle.org\/mod\/page\/view.php?id=8148", + "notificoncolor": "#f98012" } diff --git a/src/core/pushnotifications/providers/pushnotifications.ts b/src/core/pushnotifications/providers/pushnotifications.ts index 2fa632956..108f43601 100644 --- a/src/core/pushnotifications/providers/pushnotifications.ts +++ b/src/core/pushnotifications/providers/pushnotifications.ts @@ -241,7 +241,8 @@ export class CorePushNotificationsProvider { return { android: { sound: !!soundEnabled, - icon: 'smallicon' + icon: 'smallicon', + iconColor: CoreConfigConstants.notificoncolor }, ios: { alert: 'true', diff --git a/src/providers/local-notifications.ts b/src/providers/local-notifications.ts index 49ea21312..de8e89e94 100644 --- a/src/providers/local-notifications.ts +++ b/src/providers/local-notifications.ts @@ -25,6 +25,7 @@ import { CoreTextUtilsProvider } from './utils/text'; import { CoreUtilsProvider } from './utils/utils'; import { SQLiteDB, SQLiteDBTableSchema } from '@classes/sqlitedb'; import { CoreConstants } from '@core/constants'; +import { CoreConfigConstants } from '../configconstants'; import { Subject, Subscription } from 'rxjs'; /* @@ -481,6 +482,7 @@ export class CoreLocalNotificationsProvider { if (this.platform.is('android')) { notification.icon = notification.icon || 'res://icon'; notification.smallIcon = notification.smallIcon || 'res://smallicon'; + notification.color = notification.color || CoreConfigConstants.notificoncolor; const led: any = notification.led || {}; notification.led = {