Once in a few days i get 401 from APNS
vytautas-pranskunas- opened this issue · comments
Vytautas Pranskunas commented
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?
Google Open Source Bot commented
I found a few problems with this issue:
- I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
- This issue does not seem to follow the issue template. Make sure you provide all the required information.