Order push notifications are sent without android.priority, so they are held while the device is in Doze
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 75/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- firebase, php
- Domaine
- backend-api-design, mobile
Piste de recherche
Le problème pointe vers le fichier Fleetbase\Support\PushNotification::createFcmMessage(). Commencez par localiser cette méthode dans la base de code. Examinez la construction actuelle du message et la documentation Firebase Cloud Messaging (FCM) concernant les paramètres de priorité Android. Le correctif implique d'ajouter un tableau 'android' avec 'priority' => 'high' à la charge utile personnalisée. Testez en envoyant une notification push après la modification et vérifiez qu'elle arrive rapidement sur un appareil en mode Doze.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
Fleetbase\Support\PushNotification::createFcmMessage() builds the FCM message without an Android priority (android.priority). In practice the device treats order pushes (OrderAssigned, OrderDispatched, …) as normal priority, and Android holds normal-priority messages while the device is in Doze. A driver whose phone has been locked and stationary for a while does not get the "order dispatched" push until they unlock, move or charge the phone.
Impact
Drivers miss or get late order notifications. This is the most important push the Navigator app receives. The behaviour is intermittent, so it is easy to misdiagnose:
- With the phone locked for a short time (light Doze), pushes arrive.
- After ~30–60 min locked and stationary (deep Doze), they don't. They show up all at once when the phone is plugged in or unlocked.
Firebase accepts the message in both cases (a message id is returned), so nothing on the server side reports an error.
Versions
Fleetbase v0.7.63 (core-api v1.6.62), laravel-notification-channels/fcm 4.5.0, kreait/firebase-php 7.24.1. Device: Xiaomi phone with HyperOS, app battery setting "No restrictions".
Reproduction
- Log a driver into the Navigator app on an Android phone, then lock the phone and leave it stationary, unplugged, for ~60 min.
- Dispatch an order assigned to that driver. The push is accepted by FCM but is not displayed.
- Plug in the charger or unlock the phone: the push appears.
Controlled test on the same phone, after ~60 min locked and two minutes apart:
- A message identical to
createFcmMessage()'s output was not delivered. - The same message with
android.priority = highwas delivered immediately.
With the phone locked for only ~20 min, both were delivered.
Suggested fix
Set the Android priority explicitly in createFcmMessage():
->custom([
'android' => [
'priority' => 'high',
'notification' => [
'color' => '#4391EA',
'sound' => 'default',
],
'fcm_options' => [
'analytics_label' => 'analytics',
],
],
// apns unchanged
])
High priority is appropriate here: these are user-visible notifications about time-sensitive work, which is the use case FCM documents for high priority.
- Langage dominant
- PHP
- Étoiles
- 20
- Forks
- 41
- Merge moyen
- 1 j 17 min
- PR mergées (30 j)
- 31
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Issues similaires
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
rap2hpoutre/fast-excel#425 ·
-
bug Medium Priority
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
sync-en
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
sync-en
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 2 jours
-
Перевод устарел
Difficulté 1/5 1-3 heures Accessibilité débutants 78/100