Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Show ALERT_APP notifications and override silent mode #1515

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jamesarich
Copy link
Contributor

@jamesarich jamesarich commented Dec 31, 2024

This adds support for ALERT_APP messages.

Includes a new Alert notification channel, and requests permissions to override Do Not Disturb for the Alert notification channel.

This is in response to meshtastic/Meshtastic-Apple#1034 and resulting discussion on discord

Follows example here

This commit adds support for showing alert notifications with high priority and the ability to override silent mode to ensure they are delivered to the user.

The changes include:
- Adding `showAlertNotification` function which overrides silent mode and configures a custom volume, shows a notification with high priority.
- Creating a new notification channel for alerts.
- Adding the alert app port number to the list of remembered data types.
- Modifying `rememberDataPacket` to check for alert app messages and show alert notification.
This commit adds the `ACCESS_NOTIFICATION_POLICY` permission to the manifest and requests this permission from the user. It also adds a check for notification policy access in the MainActivity, and if it's not granted, shows a rationale dialog.

Additionally, the commit adds a notification override to the `showAlertNotification` function in `MeshServiceNotifications` to temporarily disable DND for alert notifications and restore the original ringer settings afterwards.
@jamesarich jamesarich marked this pull request as ready for review December 31, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant