From d3591b9c954e937230cf5522b4609de480211a5d Mon Sep 17 00:00:00 2001 From: PierreLevres <62832923+PierreLevres@users.noreply.github.com> Date: Tue, 4 Jul 2023 01:11:09 +0200 Subject: [PATCH] Fix: notification error (#253) Co-authored-by: Sean Boult <996134+Hacksore@users.noreply.github.com> --- src/controllers/european.controller.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/european.controller.ts b/src/controllers/european.controller.ts index d63f508..7bcf7b5 100644 --- a/src/controllers/european.controller.ts +++ b/src/controllers/european.controller.ts @@ -188,8 +188,7 @@ export class EuropeanController extends SessionController }); } logger.debug('@EuropeController.login: Authenticated properly with user and password'); - - const credentials = await pr.register(this.environment.GCMSenderID); + const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join(''); const notificationReponse = await got( `${this.environment.baseUrl}/api/v1/spa/notifications/register`, { @@ -205,8 +204,8 @@ export class EuropeanController extends SessionController 'Stamp': await this.environment.stamp(), }, body: { - pushRegId: credentials.gcm.token, - pushType: 'GCM', + pushRegId: genRanHex(64), + pushType: 'APNS', uuid: this.session.deviceId, }, json: true,