Skip to content

Commit

Permalink
Fix: notification error (#253)
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Boult <[email protected]>
  • Loading branch information
PierreLevres and Hacksore authored Jul 3, 2023
1 parent 6de6cb4 commit d3591b9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/controllers/european.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ export class EuropeanController extends SessionController<EuropeBlueLinkyConfig>
});
}
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`,
{
Expand All @@ -205,8 +204,8 @@ export class EuropeanController extends SessionController<EuropeBlueLinkyConfig>
'Stamp': await this.environment.stamp(),
},
body: {
pushRegId: credentials.gcm.token,
pushType: 'GCM',
pushRegId: genRanHex(64),
pushType: 'APNS',
uuid: this.session.deviceId,
},
json: true,
Expand Down

0 comments on commit d3591b9

Please sign in to comment.