Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Order push notifications are sent without android.priority, so they are held while the device is in Doze

Chiusa Adatta ai principianti
#268 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
75/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
firebase, php

Direzione di ricerca

L'issue punta al file Fleetbase\Support\PushNotification::createFcmMessage(). Inizia individuando questo metodo nella codebase. Rivedi la costruzione corrente del messaggio e la documentazione di Firebase Cloud Messaging (FCM) per le impostazioni di priorità Android. La correzione prevede l'aggiunta di un array 'android' con 'priority' => 'high' al payload personalizzato. Testa inviando una notifica push dopo la modifica e verifica che arrivi tempestivamente su un dispositivo in modalità Doze.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

  1. Log a driver into the Navigator app on an Android phone, then lock the phone and leave it stationary, unplugged, for ~60 min.
  2. Dispatch an order assigned to that driver. The push is accepted by FCM but is not displayed.
  3. 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 = high was 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.

Lingua principale
PHP
Stelle
17
Fork
39
Merge medio
1g 17m
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.