Closed luansilva-tokenlab closed 4 months ago
This looks indeed interesting. I will take a look later.
Hi @luansilva-tokenlab, thanks for your PR - this all looks great!
I noticed that due to your approach of using brightness to detect whether the screen is on or off, if the user changes their brightness slider to the lowest setting, it generates a SCREEN_OFF
event. This seems unavoidable to me, so it might be worth mentioning this in the limitations - do you agree?
Hi @luansilva-tokenlab, thanks for your PR - this all looks great!
I noticed that due to your approach of using brightness to detect whether the screen is on or off, if the user changes their brightness slider to the lowest setting, it generates a
SCREEN_OFF
event. This seems unavoidable to me, so it might be worth mentioning this in the limitations - do you agree?
I believe so. I didn't encounter this behavior during my tests, but I imagine it could vary between iOS versions, as I tested with an iPhone 7 running iOS 15 and an iPhone 6+ running iOS 12.
Got it - thanks!
In your testing, is the app able to continuously record screen events when running in the background indefinitely? And do you foresee any issues for any apps that depend on the package when going through the App Store review process with this approach?
Got it - thanks!
In your testing, is the app able to continuously record screen events when running in the background indefinitely? And do you foresee any issues for any apps that depend on the package when going through the App Store review process with this approach?
Yes, it was able to run during my tests, capturing events for up to three consecutive days without any issues. I believe this shouldn't cause any problems with the AppStore, as it is simply an analysis of features offered by Apple itself.
Wonderful, thanks for your contribution :)
I introduced iOS support to the 'screen_state' package by leveraging the 'isProtectedDataAvailable' and 'brightness' parameters for screen state analysis. Additionally, I refined the base plugin to facilitate its utilization in iOS applications, and optimized code readability and data handling with enhanced enums.
Moreover, I updated the native example apps using Flutter 3.16.9 as the foundation, addressing their outdated status and ensuring compatibility with iOS.
Despite these advancements, I encountered limitations inherent to the iOS platform. Notably, the 'isProtectedDataAvailable' parameter only provides data if the user has any form of password protection enabled, rendering it ineffective for detecting unlocks on devices without a password. Furthermore, the iOS simulator's inability to replicate device locking behavior and its distinct brightness controls hampered event detection within the simulator environment.
Throughout development, I conducted testing on an iPhone 6+ running iOS 12.5.7, successfully capturing all relevant events.