{{ device.uuid }}
+{{ pushId }}
+{{ localNotifAvailable | translate }}
diff --git a/src/core/settings/pages/about/about.ts b/src/core/settings/pages/about/about.ts index 3bdebc52b..3c6497f49 100644 --- a/src/core/settings/pages/about/about.ts +++ b/src/core/settings/pages/about/about.ts @@ -22,6 +22,7 @@ import { CoreLangProvider } from '@providers/lang'; import { CoreLocalNotificationsProvider } from '@providers/local-notifications'; import { CoreSitesProvider } from '@providers/sites'; import { CoreConfigConstants } from '../../../../configconstants'; +import { AddonPushNotificationsProvider } from '@addon/pushnotifications/providers/pushnotifications'; /** * Page that displays the about settings. @@ -53,10 +54,11 @@ export class CoreSettingsAboutPage { fsClickable: boolean; storageType: string; localNotifAvailable: string; + pushId: string; constructor(platform: Platform, device: Device, appProvider: CoreAppProvider, fileProvider: CoreFileProvider, initDelegate: CoreInitDelegate, langProvider: CoreLangProvider, sitesProvider: CoreSitesProvider, - localNotificationsProvider: CoreLocalNotificationsProvider) { + localNotificationsProvider: CoreLocalNotificationsProvider, pushNotificationsProvider: AddonPushNotificationsProvider) { const currentSite = sitesProvider.getCurrentSite(); @@ -111,5 +113,6 @@ export class CoreSettingsAboutPage { } this.localNotifAvailable = localNotificationsProvider.isAvailable() ? 'core.yes' : 'core.no'; + this.pushId = pushNotificationsProvider.getPushId(); } } diff --git a/src/lang/en.json b/src/lang/en.json index 65c423bd1..7b7086f67 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -126,6 +126,7 @@ "maxsizeandattachments": "Maximum size for new files: {{$a.size}}, maximum attachments: {{$a.attachments}}", "min": "min", "mins": "mins", + "misc": "Miscellaneous", "mod_assign": "Assignment", "mod_assignment": "Assignment 2.2 (Disabled)", "mod_book": "Book", diff --git a/src/providers/local-notifications.ts b/src/providers/local-notifications.ts index 40cfc3926..6c6b7df7c 100644 --- a/src/providers/local-notifications.ts +++ b/src/providers/local-notifications.ts @@ -15,6 +15,7 @@ import { Injectable } from '@angular/core'; import { Platform, Alert, AlertController } from 'ionic-angular'; import { LocalNotifications, ILocalNotification } from '@ionic-native/local-notifications'; +import { Push } from '@ionic-native/push'; import { TranslateService } from '@ngx-translate/core'; import { CoreAppProvider } from './app'; import { CoreConfigProvider } from './config'; @@ -104,7 +105,7 @@ export class CoreLocalNotificationsProvider { constructor(logger: CoreLoggerProvider, private localNotifications: LocalNotifications, private platform: Platform, private appProvider: CoreAppProvider, private utils: CoreUtilsProvider, private configProvider: CoreConfigProvider, private textUtils: CoreTextUtilsProvider, private translate: TranslateService, private alertCtrl: AlertController, - eventsProvider: CoreEventsProvider) { + eventsProvider: CoreEventsProvider, private push: Push) { this.logger = logger.getInstance('CoreLocalNotificationsProvider'); this.appDB = appProvider.getDB(); @@ -122,6 +123,14 @@ export class CoreLocalNotificationsProvider { this.notifyClick(notification.data); } }); + + // Create the default channel for local notifications. + this.createDefaultChannel(); + + translate.onLangChange.subscribe((event: any) => { + // Update the channel name. + this.createDefaultChannel(); + }); }); eventsProvider.on(CoreEventsProvider.SITE_DELETED, (site) => { @@ -176,6 +185,25 @@ export class CoreLocalNotificationsProvider { }); } + /** + * Create the default channel. It is used to change the name. + * + * @return {Promise