In my ViewModel I have a function, that I'm calling after checking Authorisation Status:
Код: Выделить всё
func startMonitoringAccordingSchedule() {
let schedule = DeviceActivitySchedule(intervalStart: DateComponents(hour: 0, minute: 0), intervalEnd: DateComponents(hour: 23, minute: 59), repeats: true)
let center = DeviceActivityCenter()
do {
try center.startMonitoring(.daily, during: schedule)
print("😭😭😭 Success with Starting Monitor Activity")
} catch {
print("😭😭😭 Error with Starting Monitor Activity: \(error.localizedDescription)")
}
}
может помочь мне с этим?>
Подробнее здесь: https://stackoverflow.com/questions/708 ... -correctly
Мобильная версия