Closed as not planned
Description
how can i get the screen time. For example how much time the user use his phone in last 24 hours and 7 days and in on month. i have successfully installed the dependency and get the permission but on which function you should get the time.
useEffect(() => {
requestScreenTime();
}, []);
const requestScreenTime = async () => {
ScreenTime.requestAuthorization("individual").then(async () => {
const status = await ScreenTime.getAuthorizationStatus()
console.log('Authorization status:', status) // 'approved', 'denied', or 'notDetermined'
let selection = await ScreenTime.displayFamilyActivityPicker("all");
console.log('Family activity selection:', selection);
// selection will be `null` if user presses cancel
if (selection) {
await ScreenTime.setActivitySelection(selection); // sets the shields
}
})
}
Metadata
Metadata
Assignees
Labels
No labels