I did a lot of researches, but cannot understand why methods inside DeviceActivityMonitor
extension are not calling.
What I've seen related to this question and already checked:
Do you starting monitoring for schedules?
- Yes, I do by calling
center.startMonitoring()
as it has been explained on WWDC2021-10123.
I was searching an issue while creating the extension. Walk through steps that are described here.
- Everything looks good for me.
Did you add Family Control Capability to extension's target?
- Yes, I did.
Is your device authorized with FamilyControls?
- Yes. The only doubt I have here that I'm authorising FamilyControls for
.individual
. But as I've asked previously, it shouldn’t be a reason.
Task {
do {
guard #available(iOS 16.0, *) else {
// Fallback on earlier versions
return
}
try await AuthorizationCenter.shared.requestAuthorization(for: .individual)
switch AuthorizationCenter.shared.authorizationStatus {
case .notDetermined:
print("not determined")
case .denied:
print("denied")
case .approved:
print("approved")
@unknown default:
break
}
} catch {
print("Error for Family Controls: (error)", error.localizedDescription)
}
}
--
So, what could I have missed?
Also, should I see bundles of app and extension in Xcode -> Debug -> Attach to Process -> ...
or I have to add them to see logs in Console app?
It sounds like you're doing everything right, so it's difficult to offer guidance without seeing your app and extension. Please file a bug report using Feedback Assistant and attach your Xcode project. Thanks in advance!