KV
Size: a a a
KV
М
АК
АК
М
AS
SD
AS
Ć
Ć
Ć
SD
AS
pushObject.on('notification').subscribe((notification: any) => {
this.processNotification(notification);
});
Ć
pushObject.on('notification').subscribe((notification: any) => {
this.processNotification(notification);
});
AS
AS
AS
this.logger.log(`PushService: Старт инициализации OneSignal`);
this.oneSignal.startInit(environment.oneSignalAppId, environment.androidAppid);
this.oneSignal.handleNotificationReceived().subscribe((data) => {
this.logger.log(`PushService: handleNotificationReceived: ${JSON.stringify(data)}`);
this.recieved.next(data);
});
this.oneSignal.handleNotificationOpened().subscribe((data) => {
this.logger.log(`PushService: handleNotificationOpened: ${JSON.stringify(data)}`);
this.opened.next(data);
});
this.logger.log(`PushService: Старт регистрации приложения в OneSignal`);
this.oneSignal.endInit();
this.logger.log(`PushService: Финиш инициализации OneSignal`);
this.oneSignal.getIds().then(value => {
this.logger.log(`PushService: Приложение успешно зарегестрировано в OneSignal: userId: ${value.userId}, pushToken: ${value.pushToken}`);
this.registration = {
userId: value.userId,
pushToken: value.pushToken
};
resolve(this.registration);
}).catch(err => {
this.logger.log(`PushService: Ошибка регистрации приложения в OneSignal: ${JSON.stringify(err)}`);
reject(new Diag(`Ошибка регистрации в OneSignal: ${err}`, err));
});
AS
AT
AS