It seems that they are measuring the usage time of the terminal.
(General>Usage>Battery Usage>Time of use)
Is it possible to get that information from the app?
Is it possible to start the application in the background and get the time when the terminal wakes up from sleep?
Also, is it possible to get the time of sleep in the background after the terminal sleeps?
Is there any other way to measure iPhone usage time?
Please let me know.
ios objective-c swift xcode iphone
The NSProcessInfo systemUptime function tells you how long (in seconds) it will be used.
When you sleep, the uptime does not increase, so it seems to be the cumulative amount of time you have been running the terminal since you started it.
Is it possible to get the time when the terminal sleeps in the background after it sleeps?
Wouldn't it be possible to do this by using Background Fetch?
Application:performFetchWithCompletionHandler is called for every set time (approximate), so you may want to try to find the time difference from the time when the application started.
Search for the Background Fetch description and you'll find a lot of information.
© 2024 OneMinuteCode. All rights reserved.