-
Notifications
You must be signed in to change notification settings - Fork 415
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
[BUG] MediaElement Notification Prompt Overrides and Alters Push Notification Settings on Android #2364
Comments
Media Element uses notifications to put the controls in the notification tray. If you can upvote #2074 I would appreciate it. I will bring it up at the next monthly toolkit meeting. It is a good idea and we should implement a way to disable requesting notifications so developers can handle it directly. ATM we are blocked from new PR being commited to main until we merge #2215 and then we need to merge #2075 which is currently blocked by dotnet/android#9535 which we have to wait for new version of dotnet android to be pushed to visual studio stable. We can talk about updating media element to support this and I will work on a PR to fix it and add support to allow developers to choose whether to disable notifications and/or add support and control it themselves. Disabling notifications or not having support when media element is running will disable support for both lockscreen and notification controls. This will also prevent the service from running but will not impact media element running directly. Upvoting the discussion shows us how many ppl are interested in a feature and will allow me to show strong support if it has enough upvotes. I will try and push it through either way as I believe it should be done. I don't see a downside. We are currently working on merging a PR that switches us from using deprecated android libraries and using media 3 instead of older libs. |
All notifications can now be handled by developer and media element will not require any requests to user for access to notifications. That will be handled by OS silently with media 3 PR from now on. So this issue can be closed after today meeting. If you can test against #2076 you can see the changes in action. The developer still needs to put the lines for service module but if they fail to do so it will NOT crash the app. It will now just not display media notifications if service is not included in android manifest. So if you want to disable media notifications u can just not include the service description in the manifest. Users will no longer be prompted at all my media element for any notification access. This is now in current PR listed above and I am requesting anyone with this issue to test against it. |
Are you implying that the Notification permission is required to show the buttons in notification? If so, I don't think that is true. Notifications for transport controls are typically tied to a Foreground Service when media playback occurs in the background. These notifications do not require explicit notification permissions, as they are classified as essential system notifications. |
Should this work by now? I just switched my entire project to .NET 9 so I can test the latest version of CommunityToolkit + MediaElement. Unfortunately, the notification request is still displayed as soon as a video is played. |
@ne0rrmatrix has linked a pull request scheduled to close this issue on Dec 5, 2024. but the issue is still open, and its state hasn’t changed. Review is still required, as the new changes need approval from someone other than the last person who pushed. Merging remains blocked but can be performed automatically with 1 approving review. |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The MediaElement component triggers a notification prompt asking for permission to send notifications, even when the user is only trying to play a video.
The prompt causes confusion, as selecting "Allow" or "Don't Allow" unintentionally modifies the push notification settings, which is unrelated to video playback.
Expected Behavior
The MediaElement should not trigger a notification prompt if it is unrelated to video playback.
The notification prompt should not affect or change the notification settings in any way.
There should be a way to customize or disable this prompt for better user experience.
Steps To Reproduce
Link to public reproduction project repository
https://github.com/CommunityToolkit/Maui/tree/main/samples
Environment
Anything else?
references the existing discussion on GitHub to provide more context and indicate that no attention has been given to the issue so far. This should help bring awareness to the problem and possibly generate more responses or solutions.
#2074
The text was updated successfully, but these errors were encountered: