Repository navigation
What's new
Installed-app insights for Android (#3).
New methods
getInstalledApps(options?): lists launchable apps with their metadata: name, version, install/update time, target/min SDK, category, requested permission count, system flag and an optional base64 icon. When "Usage access" is granted it also returns foreground time, last-used time, launch count and storage size (app / data / cache /- Options:
includeSystemApps,includeIcons,sortBy(totalSize|usageTime|lastUsed|name),usagePeriod(day|week|month|year),limit. - Runs on a background thread.
- Options:
hasUsageAccessPermission(): checks whetherPACKAGE_USAGE_STATSis granted.openUsageAccessSettings(): opens the system "Usage access" screen.openAppSettings(packageName): opens the system "App info" screen for a package.getDeviceMemoryInfo(): device-wide RAM snapshot (total, available, used, low-memory flag and threshold).
Android manifest (merged into your app)
The library now ships an AndroidManifest.xml that adds:
android.permission.PACKAGE_USAGE_STATS: a special permission the user grants in Settings. It is only needed for the usage and storage fields.<queries>forMAIN/LAUNCHERandgeo:VIEW intents, so app listing andopenAppWithLocationwork on Android 11+ withoutQUERY_ALL_PACKAGES.
If your app doesn't use getInstalledApps and you don't want the permission declared, remove it with:
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" tools:node="remove" />Other changes
- The
TurboModuletype is now imported fromreact-nativeinstead of the deepreact-native/Libraries/TurboModule/RCTExportpath. - README: docs for the new APIs and a local-development guide.
Notes
- Per-app RAM usage is not available: Android has no Play-compliant API for it.
launchCountcounts foreground transitions in the period, so it can be higher than the actual number of app launches.
Full Changelog: v1.0.3...v1.0.4