Skip to content

Commit d3591b9

Browse files
PierreLevresHacksore
andauthoredJul 3, 2023
Fix: notification error (#253)
Co-authored-by: Sean Boult <[email protected]>
1 parent 6de6cb4 commit d3591b9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed
 

‎src/controllers/european.controller.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ export class EuropeanController extends SessionController<EuropeBlueLinkyConfig>
188188
});
189189
}
190190
logger.debug('@EuropeController.login: Authenticated properly with user and password');
191-
192-
const credentials = await pr.register(this.environment.GCMSenderID);
191+
const genRanHex = size => [...Array(size)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
193192
const notificationReponse = await got(
194193
`${this.environment.baseUrl}/api/v1/spa/notifications/register`,
195194
{
@@ -205,8 +204,8 @@ export class EuropeanController extends SessionController<EuropeBlueLinkyConfig>
205204
'Stamp': await this.environment.stamp(),
206205
},
207206
body: {
208-
pushRegId: credentials.gcm.token,
209-
pushType: 'GCM',
207+
pushRegId: genRanHex(64),
208+
pushType: 'APNS',
210209
uuid: this.session.deviceId,
211210
},
212211
json: true,

0 commit comments

Comments
 (0)
Please sign in to comment.