Hi,
Problem: Even after successful schedule creation I am not getting call backs(intervalDidStart, intervalDidEnd) to my extension
I have created DeviceActivityMonitor extension by creating call Directory Extension and updated info plist with the value (com.apple.deviceactivity.monitor-extension) and updated principal class value too.
I try running the extension on my demo app which has the below code,
let schedule = DeviceActivitySchedule(
intervalStart: DateComponents(hour: 10, minute: 30),
intervalEnd: DateComponents(hour: 12, minute: 15),
repeats: true,
warningTime: nil)
do {
let center = DeviceActivityCenter()
center.stopMonitoring([.daily])
try center.startMonitoring(.daily, during: schedule)
print("Schedule created")
print(center.activities)
} catch {
print(error)
}
}
My extension has the below code,
override func intervalDidStart(for activity: DeviceActivityName) {
super.intervalDidStart(for: activity)
print("Entered Did Start")
}
override func intervalDidEnd(for activity: DeviceActivityName) {
super.intervalDidEnd(for: activity)
print("Entered Did End")
}
Please guide me to find out the issue. Thanks in advance.