Search code examples
iosswiftios15

Getting Applications from DeviceActivityEvent swift


I'm trying to use DeviceActivityEvent.

var comps = DateComponents()
comps.month = 4
let event = DeviceActivityEvent( threshold: comps)

Tried above approaches but no good. Any help/tutorial or a sample code would be appreciated. As it's a newly launched API by Apple, So there's slim to none info provided yet.


Solution

  • These three frameworks are related,

    Managed Settings Family Controls DeviceActivity

    Device Activity is about running our code without launching the app. Device Activity Event are monitors that call extensions when the user reaches the threshold in a Device Activity Schedule.

    You can get all the help about this from the apple WWDC2021.