Repository navigation
fix(notify): stop alerts from being lost, replaced or held back - #615
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
whes1015
force-pushed
the
fix/notification-delivery
branch
from
October 16, 2026 18:19
233d97a to
c8ca126
Compare
This was referenced Oct 16, 2026
This was referenced Oct 16, 2026
whes1015
added this pull request to stack #626
October 16, 2026 19:21
whes1015
force-pushed
the
fix/notification-delivery
branch
from
October 16, 2026 19:31
c8ca126 to
2addde0
Compare
Member
Author
Platform: android Fix(zh-Hant): 修正同時收到多則警報時,前一則會被下一則蓋掉,通知欄只剩最後一則 Fix(en-US): fix alerts arriving together replacing one another so only the last stayed in the notification shade
Platform: android Fix(zh-Hant): 修正系統代為顯示的推播指定了不認得的類別時,會落到「其他」並使用系統預設音效 Fix(en-US): fix pushes the system shows for an unknown category landing in "Miscellaneous" with the default sound
Platform: android Fix(zh-Hant): 修正升級後系統通知設定裡留著舊版的重複通知類別,關掉它們其實沒有任何作用 Fix(en-US): fix upgraded phones listing leftover duplicate notification categories in system settings that no longer control anything
Platform: ios Fix(zh-Hant): 修正 iOS 開啟專注模式或睡眠模式時,地震速報等即時警報會被擋下、等解除後才出現 Fix(en-US): fix time-sensitive alerts such as earthquake warnings being held back by Focus or Sleep on iOS
Platform: ios New(zh-Hant): iOS「設定」裡 DPIP 的通知頁面多了一個連結,點了會直接打開 app 內的通知設定 New(en-US): iOS Settings now links from DPIP's notification page straight to the app's own notification settings
whes1015
force-pushed
the
fix/notification-delivery
branch
from
October 16, 2026 19:37
2addde0 to
676cff1
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
這個 PR 做了什麼
修正幾個讓通知「送到了卻沒被看到」的問題:Android 上不同警報互相覆蓋、未知頻道的推播落到「其他」類別、舊版留下的死頻道,以及 iOS 的專注模式擋下重要通知。另外在 iOS 設定的 DPIP 通知頁加上連回 app 通知設定的入口。
改動內容
正式程式碼
bb8fa520超大通知 id 不再變成 0(Android)_asNotificationId超出 32 位元就回傳 null,最後一律變成0。同時到達的速報、震度速報和天氣警特報因此擠在同一個通知位置,只剩最後一則。false,推播就不見了。現在先把content.id改寫好再交出去,失敗會記 log。11e03e0a預設 FCM 頻道(Android)AndroidManifest.xml加上com.google.firebase.messaging.default_notification_channel_id,指向announcement-general-v2。6f021131刪除舊版留下的頻道(Android)RetiredChannels.keys列出從 git 歷史找到的 51 個舊頻道 id,也涵蓋 awesome 用<key>_<md5>形式註冊的版本。PlainChannelsChannel.kt新增list和delete。清理放在頻道設定的最後,已經乾淨的手機只多一次呼叫。2468b353iOS 加上 time-sensitive entitlementRunner.entitlements和RunnerRelease.entitlements都加上com.apple.developer.usernotifications.time-sensitive。.timeSensitive,但沒有這個 entitlement,iOS 會把它們當一般通知,專注模式和睡眠時會擋下。影響範圍是所有沒開重大警報的頻道(強震即時警報、震度速報、海嘯一般、大雷雨、豪雨、疏散避難),以及拒絕重大警報授權的使用者收到的所有速報。676cff14iOS 設定連回 app 通知設定NotificationSettingsLinkPlugin.swift:只在通知已授權時才多要求這個選項,使用者不會看到任何對話框;重大警報不在這次要求內。NotificationDelegateProxy把設定頁那一列的點擊轉給 Dart;app 被這個點擊啟動時也會補送。routeNotificationSettingsLink:在目前畫面上方開通知設定頁;已經開著就不重複開,新手引導期間不動作。測試
content_from_data_test.dart、notification_service_test.dart:id 對應、非數字 id、app 被關掉時的路徑。fcm_default_channel_test.dart:預設頻道必須是頻道清單裡真的存在的頻道(改壞會失敗,已驗證)。retired_channels_test.dart:舊頻道清單不包含任何目前使用中的頻道。ios_entitlements_test.dart:兩個 entitlements 檔都有 time-sensitive。notification_settings_link_test.dart、notification_routes_test.dart、onboarding_permissions_test.dart:導向行為。相關 issue
沒有對應的 issue,是檢查通知送達路徑時發現的。
怎麼驗
tool/commit.sh --push通過(analyze、codegen、全部 Dart 測試)。tool/dev/test_ios.sh:370 個 XCTest 全部通過,新的 Swift 檔有一起編譯。com.exptech.dpip.dpip開啟 Time Sensitive Notifications。release workflow 用-allowProvisioningUpdates自動簽章,開啟後描述檔會自動更新;PR 的 iOS CI 用--no-codesign,所以抓不到這個問題。interruption-level: time-sensitive才有效,這部分在後端另外處理。沒部署前,entitlement 只對 app 自己發的本機通知有效。-v2頻道,log 有「deleted N retired channel(s)」。檢查清單
tool/check/commits.sh origin/main..HEAD通過tool/commit.sh --push)