Merge pull request #1527 from dpalou/MOBILE-2590

MOBILE-2590 pushnotifications: Fix click when the app is closed
main
Juan Leyva 2018-09-21 18:18:29 +02:00 committed by GitHub
commit 4dccd050e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -14,11 +14,11 @@
import { Injectable, NgZone } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Platform } from 'ionic-angular';
import { Badge } from '@ionic-native/badge';
import { Push, PushObject, PushOptions } from '@ionic-native/push';
import { Device } from '@ionic-native/device';
import { CoreAppProvider } from '@providers/app';
import { CoreInitDelegate } from '@providers/init';
import { CoreLoggerProvider } from '@providers/logger';
import { CoreSitesProvider } from '@providers/sites';
import { AddonPushNotificationsDelegate } from './delegate';
@ -62,7 +62,7 @@ export class AddonPushNotificationsProvider {
}
];
constructor(logger: CoreLoggerProvider, protected appProvider: CoreAppProvider, private platform: Platform,
constructor(logger: CoreLoggerProvider, protected appProvider: CoreAppProvider, private initDelegate: CoreInitDelegate,
protected pushNotificationsDelegate: AddonPushNotificationsDelegate, protected sitesProvider: CoreSitesProvider,
private badge: Badge, private localNotificationsProvider: CoreLocalNotificationsProvider,
private utils: CoreUtilsProvider, private textUtils: CoreTextUtilsProvider, private push: Push,
@ -134,7 +134,7 @@ export class AddonPushNotificationsProvider {
* @param {any} notification Notification.
*/
notificationClicked(notification: any): void {
this.platform.ready().then(() => {
this.initDelegate.ready().then(() => {
this.pushNotificationsDelegate.clicked(notification);
});
}
@ -189,7 +189,7 @@ export class AddonPushNotificationsProvider {
}
// Trigger a notification received event.
this.platform.ready().then(() => {
this.initDelegate.ready().then(() => {
data.title = notification.title;
data.message = notification.message;
this.pushNotificationsDelegate.received(data);