0.1.6 • Published 11 months ago
react-native-app-usage v0.1.6
react-native-app-usage
This package will get the app usage stats
Installation
yarn add react-native-app-usage
Usage
import { requestUsagePermission,getUsageLast24Hr,checkPackagePermission } from 'react-native-app-usage';
// ...
checkPackagePermission().then(permissionGranted=>{
if(!permissionGranted)
{
requestUsagePermission() ;// If permission not granted then request for permission
}
else{
getUsageLast24Hr((data)=>{
let allAppUsage=data; // You can get all app usage data of past 24 Hrs
})
}
}).catch(error=>{
console.log('error==>',error);
})
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT