-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Battery usage of the application #102
Comments
Hi @dev-chetan, I might be mistaken but I'm pretty sure that sending a silent notification before alarm rings won't wake the app. Do you have more information on the amount of battery used ? You can see details in Settings > Battery. |
Sure, I can research with silent notification. |
The 70% you see in your iOS battery settings for an app means that app used 70% of the total battery consumed during that period, not that it used up 70% of your battery’s total capacity. |
Thanks for the quick response, |
After full day of 100 --> 0% battery, I experienced 36% of iPhone 13 Pro battery from only background alarm app usage (19 hours total) |
Could you share a screenshot of this screen please ? It could really help. If relevant, please share the last 10 days, last 24 hours and a specific hour. |
@gdelataillade here are 2 screenshots from 24 hours, at the moment it’s difficult to do a longer test as battery life gets cut almost in half, reducing functionality of phone significantly you’ll notice that 3 hours of watching videos on Instagram is still a significantly less battery than current alarm background fetch |
Hi @Brandonfas Thanks for the screenshot. I'll think about a way to use less battery, but honestly I don't have any idea in mind... |
Everyone that has battery issues please share your battery usage. |
@gdelataillade My app does not require the alarm to be active all the time. I want the alarm to be deactivated in the background again when the [end button] is pressed. |
@gdelataillade In the second screenshot, you can see that the battery is draining at 4-5am, even though the smartphone is not being used and there is no active alarm. Before I went to bed, the battery was at 97%, but when I checked it in the morning, it was down to less than 50%. If there is no active alarm, we need a way to stop background tasks from draining the battery.
In my opinion, this is very critical and users will not use the app if it is constantly draining battery like this. I am using version 2.1.1 and tested on iPhone14 iOS17. |
Hi @synstin Thanks for your feedback. Alarm background process is supposed to be automatically disposed when all alarms are stopped. Maybe there is a memory leak somewhere. I'll investigate this as soon as I find the time. |
I use a silent audio player to keep the alarm app active in the background, but only when an alarm is scheduled. This method is similar to what's used in other alarm apps like Alarmy. They seem to optimize battery life by playing the silent audio briefly, perhaps for 1 second every 10 seconds, instead of continuously. I plan to implement this intermittent playback method in my app as well to see if it helps save battery life. |
I did stopAll() when I received the alarm completion event on the stream and the battery leak went away. |
Hello everyone, I had the opportunity to test the package by taking a solution on the market as a comparison (alarmy). You can see on the screenshots that the consumption of the two alarms is identical. Unfortunately, Apple's current policy does not allow you to call an alarm with the application killed, and the need to keep an activity in the background is costly in terms of energy. Congratulations once again on all your hard work! |
Would it be more optimal to check 1 second every 1 minute? Since alarms are set at a minute level anyway That would be 1/60th of background audio playing compared to existing application battery life If not, no problem. Just a thought! |
Hi @Brandonfas Thanks for your suggestion to reduce the silent audio playback to 1 second per minute. It's an interesting idea, but I need to consider the limitations of my current approach. While it does consume a significant amount of battery, it's similar to methods used by established apps like Alarmy. This similarity suggests that under current iOS constraints, this might be one of the more viable options. As a solo developer continuously learning about iOS development, implementing major changes to background task management could lead to unexpected challenges, particularly given the complex nature of iOS's handling of such tasks. Although I'm aware that my method isn't the most battery-efficient, altering the playback frequency could risk the app being terminated prematurely by iOS. I'll stick with the existing method for now, but I'm definitely open to exploring more efficient solutions as I enhance my understanding of iOS development. Contributions, research, feedback, or any help would be greatly appreciated and could significantly aid in improving the package in future releases. |
Possibly give the user a choice to configure the silent audio playback, some apps need alarm at a minute level accuracy some need alarm at a sec level, with this knob, developers will know why its eating battery and experiment with it(vs having to reach out to you) |
I've done some additional research into Alarmy and apparently they went from continuous to 1 second every 10 seconds in version 6.63.0 for the exact purpose of battery draining. Is this something that could be possibly implemented? I love this application, only limitation seems to be battery drain in terms of long-term usage and user satisfaction. Thanks again for all of the hard work you've done! |
Hi @Brandonfas Thank you for your research ! Could you provide the link where you read about the "1 second every 10 seconds" please ? It's probably something I could implement in the plugin but it won't be easy to be honest. Do you see a significant difference of the battery usage between Alarmy and my alarm plugin ? |
@gdelataillade |
@synstin that's weird I did not make any changes on iOS on the background process part in the last weeks... could you share some of your battery usage ? |
@gdelataillade |
Thanks for your effort and great work.
Alarms are ringing as expected on the iOS however I noticed huge jump in the battery usage of the application. If I am understanding correct than we are keeping application active in background and due to that battery usage is high so as a workaround can we send a silent notification just before the alarm time and make our application active. This way we will not have to keep our application active all the time, and we can save some battery. Please share your thoughts on this.
The text was updated successfully, but these errors were encountered: