Skip to content

Once in a few days i get 401 from APNS #2294

@vytautas-pranskunas-

Description

@vytautas-pranskunas-

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?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions