-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Labels
Description
I have webhook wich is triggered randomly when users doing some things and sometimes firebase-admin messaging returns 401 when trying to send push. I cannot manualy reproduce it but it in logs.
here is my code
this init function is invoked upon server start in main.ts
const serviceAccount = require('../../../senioassist-fb.json');
export class AuthService {
static init() {
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});
}
}and after i have
export class PushNotificationsService {
try {
await admin.messaging().send(messages[0]);
}} catch (err) {
var m = messages.map(m => JSON.stringify(m)).join(' ;==============; ');
errorLoggingService.logError(err, m, ErrorTag.PushNotification);
isSuccess = false;
}any idea?
p.s. i found something similar here: firebase/firebase-functions#579 maybe?