You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
}
})
}
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: