package_usage_stats 0.0.3 copy "package_usage_stats: ^0.0.3" to clipboard
package_usage_stats: ^0.0.3 copied to clipboard

PlatformAndroid

A flutter package for getting app usage information from the phone

package_usage_stats #

A simple (for now) package for accessing the current status of android.manifest.PACKAGE_USAGE_STATS permission.

checkPermissionStatus() Returns true if the PACKAGE_USAGE_STATS permission is granted for the app, false otherwise

openAppUsageSettings() Opens an activity window where the user can see all the apps those request the PACKAGE_USAGE_STATS permission. Upon selecting the desired app, user can grant or deny the permission. Because PACKAGE_USAGE_STATS considered as a dangerous permission, it is the only way to get the permission on Android.

onPermissionStatusChanged() Starts listening for the PACKAGE_USAGE_STATS permission status change. This method is useful when you want to know the status of the permission at any point of time, including the time when the app is backgrounded. Returns a stream of [bool?] events, indicating the current status of the permission

Installation Requirements For Android #

You need to add <uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" /> in your AndroidManifest.xml Minimum required SDK is 21. This package will not work below < SDK 21, Lollipop

For iOS #

There is no direct equivalent of this API on iOS, however the new ScreenTime API might be considered for iOS devices, this package does not support any iOS counterpart yet.

0
likes
140
pub points
57%
popularity

Publisher

verified publisherstunware.com

A flutter package for getting app usage information from the phone

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on package_usage_stats