mirror of
https://github.com/mattermost/mattermost-mobile.git
synced 2026-11-17 08:58:21 +00:00
Harden MessagingStyle notifications for Android Auto: declare Auto notification capability, conversation shortcuts, mark-as-read and reply semantic actions, and per-conversation MessagingStyle history. Co-authored-by: Sven Hüster <svelle@users.noreply.github.com>
2.8 KiB
2.8 KiB
Android Auto Messaging Notifications
Findings
Mattermost Mobile has no dedicated Android Auto / Car App Library UI. Message notifications can still surface in Android Auto when they follow the platform messaging template.
What already existed
- FCM →
react-native-notifications→ nativeCustomPushNotification/CustomPushNotificationHelper NotificationCompat.MessagingStylewithPerson(and avatars when available)Notification.CATEGORY_MESSAGEon a high-importance channel- Inline reply via
RemoteInputwhen the push payload includescategory: CAN_REPLY - Grouping by
channel_idor CRTroot_id
Gaps addressed for Android Auto
| Requirement | Implementation |
|---|---|
| Declare Auto notification support | res/xml/automotive_app_desc.xml + manifest meta-data |
| Reply semantic action + no UI | SEMANTIC_ACTION_REPLY, setShowsUserInterface(false) |
| Mark-as-read action | Invisible SEMANTIC_ACTION_MARK_AS_READ action |
| Conversation shortcuts | Long-lived dynamic shortcuts + setShortcutId / LocusId |
| Conversation history in MessagingStyle | Per-conversation message cache used when building style |
iOS parallel
iOS has no CarPlay app either; it uses communication notifications via INSendMessageIntent in the notification service extension.
Key files
android/app/src/main/java/com/mattermost/helpers/CustomPushNotificationHelper.javaandroid/app/src/main/java/com/mattermost/helpers/NotificationConversationStore.ktandroid/app/src/main/java/com/mattermost/helpers/ConversationShortcutHelper.ktandroid/app/src/main/java/com/mattermost/rnbeta/NotificationReplyBroadcastReceiver.javaandroid/app/src/main/java/com/mattermost/rnbeta/NotificationMarkAsReadReceiver.java
Manual QA (Android Auto Desktop Head Unit)
- Connect a phone with a Mattermost debug build to DHU / a head unit.
- Receive a channel message while Auto is active — notification appears in Auto.
- Receive a second message in the same channel — prior message remains in the conversation history read aloud / shown.
- Use voice reply (requires server
category: CAN_REPLY) — reply posts and appears as “Me”. - Mark as read from Auto — notifications for that conversation dismiss; channel is marked viewed on the server.
- Verify DM vs channel/group conversation titles and shortcuts.