Order push notifications are sent without android.priority, so they are held while the device is in Doze
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- firebase, php
調査の方向性
この issue は、ファイル Fleetbase\Support\PushNotification::createFcmMessage() を指しています。まず、コードベース内でこのメソッドを見つけてください。現在のメッセージ構築と、Android の優先度設定に関する Firebase Cloud Messaging (FCM) のドキュメントを確認します。修正には、カスタムペイロードに 'priority' => 'high' を含む 'android' 配列を追加することが含まれます。変更後にプッシュ通知を送信し、Doze モードのデバイスに迅速に届くことを確認してテストしてください。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- PHP
- スター
- 17
- フォーク
- 39
- 平均マージ
- 1日 17分
- マージ済み PR(30日)
- 31
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
Awaiting Triage
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
WordPress/two-factor#1008 ·
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
sync-en
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Перевод устарел
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 22 日以内に返信