Open shemtovsamuel opened 1 year ago
Obviously a good practice, similar to Sensor Leak
in the ecoCode plugin for native Android (see here).
In the absence of a plugin dedicated to react-native technology, this proposal is in a pending state.
Hello! Sorry, I've only just seen this issue. I think it's a very good idea and the rule seems implementable in the ecoCode-javascript plugin because React's native code base is in javascript.
I agree but I do not see this rule in the javascript project but in a dedicated react-native plugin. Or may be at least in the javascript plugin but in a dedicated integrated profile. I think we should set this rule as ok to be implemented.
Energy Efficiency: Optimize Mobile Sensor Usage
Platform
Main characteristics
Severity / Remediation Costs
Rule short description
Limit the use of mobile sensors to necessary situations and disable them when their functionality is not required.
Rule complete description
To reduce energy consumption and make mobile applications more eco-friendly, it is crucial to limit the use of mobile sensors, such as accelerometers and gyroscopes, to necessary situations and disable them when their functionality is not required. This prolongs battery life and enhances the user experience.
HTML
Implementation principle
package.json
file to identify sensor-related libraries (e.g.,react-native-sensors
,react-native-geolocation
,react-native-barometer
,react-native-fingerprint-scanner
).componentDidMount
andcomponentWillUnmount
.