When pwa is in background, the serviceworker still uses onMessage not onBackgroundMessage!
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- angular, firebase, typescript
Línea de trabajo
Comienza comparando la configuración de onMessage del servicio con el registro de onBackgroundMessage en firebase-messaging-sw.js y, a continuación, reproduce el comportamiento con la PWA en segundo plano. Se considera terminado cuando el handler esperado está establecido y el comportamiento al tocar la notificación se ha corregido o la limitación está claramente documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Hello,
when I send a push notification to my app, the onMessage method is called even if it is in the background! Actually, the onBackgroundMessage should then be called, right? The problem now is that when I tap on the message box in Android, the Progressive Web Application is not brought to the foreground. Apparently Android thinks that the app is in the foreground? The message box disappears when I tap on it and the number of incoming messages also disappears from the app icon.
Is there any way to fix this?
The onMessage is defined in a service
this.message$ = new Observable(sub => onMessage(this.messaging, it => sub.next(it))).pipe(
tap(payload => {this.print.info('MessagingService initFCMMessaging() FCM fmessage', { payload });})
);
The onBackgroundMessage is defined in the firebase-messaging-sw.js with static text.
`messaging.onBackgroundMessage(function(payload) {
// Customize notification here
const notificationTitle = 'My title';
const notificationOptions = {
body: 'My Bodytext',
icon: '/firebase-logo.png' || '/assets/icons/icon-72x72.png'
};
self.registration.showNotification(notificationTitle, notificationOptions);
});`
I only noticed this because I defined a static text for the background message.
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.8k
- Forks
- 2.2k
- Merge medio
- 3 d 6 h
- PR fusionados (30 d)
- 5
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de angular/angularfire
-
comp: build/pipeline type: bug version: current (v17+)
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
angular/angularfire#3766 ·
-
comp: schematics type: bug version: current (v17+)
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
angular/angularfire#3768 ·
-
comp: docs type: chore version: current (v17+)
Dificultad 4/5 3-5 días Aptitud para principiantes 58/100
angular/angularfire#3764 ·
-
comp: firestore comp: ssr priority: P0 (critical) type: feature version: current (v17+)
angular/angularfire#3757 · 1 asignado ·
-
Six `firebase` entry points have no `@angular/fire` equivalent, so their exports are unreachable Abiertocomp: core type: feature
angular/angularfire#3755 · 1 asignado ·
Todos los issues de angular/angularfire
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modelcontextprotocol/inspector#2458 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 75/100
railmapgen/rmp-gallery#4068 ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
carbon-design-system/ibm-products#9907 ·