-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Android] Your app schedules exact alarms without checking whether the SCHEDULE_EXACT_ALARM permission has been granted. #465
Comments
Im also facing this! |
Nope! I read a comment on another issue that a potential fix is in master. There needs to be a new release ideally. I tried cloning the code and including it in the project but I had all sorts of issues. Plus that didn't seem right to me. |
@owenashurst new releases are planned only to be release using .Net 8 Maui also does not require <uses-permission android:name="android.permission.USE_EXACT_ALARM" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> |
Thanks for the reply @thudugala. I'm already targeting .NET 8 since it's a relatively new app. Could you provide an estimate on when you plan to release the new version, please? |
@owenashurst can release new version, if you do not any issues with latest pre release version |
@thudugala Just installed the pre-release, and it seems to still work fine (for android at least). I think you're good. I'm ready to deploy a new version of my app, so I'm happy to update once you release so I can publish. Quick question, are you saying I can remove the following permissions after your release?
|
@owenashurst yes. But please remember notification will not pop up at the exact time. Try with the pre release |
@thudugala My app doesn't need to be exact. As long as it shows the notification +- a few seconds and not minutes. I've just tried with the above permissions removed and it was still relatively exact. Although this was inside an Android Emulator. Does that mean it's good? |
@owenashurst yes. |
@thudugala Brilliant. Looking forward to the release. Thank you. |
Will release tonight at about 10 pm New Zealand time |
@owenashurst Please try version 11.1.0 |
Thanks for the update @thudugala In the Wiki you have:
Could you elaborate, when should we use the optional permissions and when should we avoid them? :) |
@vallgrenerik if you want notifications to fire at the exact time you need the optional permission. |
Hi, I'm having this problem too, in Google Play Console I can see the same warning for Android 14 that the original poster described. My App is developed with .net 7.0. It's not clear to me if I have to update to version 11.1.0 and .net 8.0 in order to solve the problem or if it is possible to deal with the permissions also without porting to .net 8.0. Thank you |
For .NET8.0 Google Play fires me warning: "Your app schedules exact alarms without checking whether the SCHEDULE_EXACT_ALARM permission has been granted. This is causing your app to crash for users on Android 14 because the permission is no longer granted by default". I was managed to request SCHEDULE_EXACT_ALARM permission (Android, API 31+) using android native classes (MainActivity.cs):
|
Except the permissions in
and then call:
|
I'm working on a Do you have any suggestions/ideas how can I fix it? |
I had to remove So I kept After that Google allowed our release. But I still see the warning that for some of our users it can crash the app. I have no idea why because before every notification call we have permission check |
Just to clarify for me. You kept in the AndroidManifest.xml the line
and then add the code in the code above. How did you define |
yes
Here are some parts of my notification service + extension method I use for permissions:
|
@Kebechet Thank you so much! Very useful! |
In my app I can enable those alarms. I have all these permissions enabled:
otherwise I dunno what could be wrong with your implementation |
After upgrading to the latest version of the library the error disappeared |
Describe the bug
When publishing release builds to the Google Play Developer Console, I found that it is showing me an error for the SCHEDULE_EXACT_ALARM permission. The exact error is:
The AndroidManifest has the permissions enabled outlined in the Wiki for this plugin, including the SCHEDULE_EXACT_ALARM permission. When testing via debug, I can see the notification that was scheduled fine (Google Pixel 5 emulator & My own Google Pixel 7 Pro).
I'm aware you can use Android specific namespaces to request this permission manually, however the issue is I am planning to also make a build for iOS, and from my experience prior to knowing about this plugin, I tried to create notifications via
Intent
, however the build would fail since iOS does not know about Android specific code. Even by conditionally registering an Android class via Dependency Injection with#if Android
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I should expect the plugin to have the ability to request missing permissions that it uses internally, instead of just one ability to Request Notification permissions.
Platform (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: