init(applications:categories:webDomains:threshold:)
Creates a new event.
Declaration
init(applications: Set<ApplicationToken> = [], categories: Set<ActivityCategoryToken> = [], webDomains: Set<WebDomainToken> = [], threshold: DateComponents)Parameters
- applications:
An optional list of applications to include in the event. A small subset of popular App Store apps have known associated web domains that get included implicitly. For example, an event that includes an app implicitly includes usage of the app’s web domain.
- categories:
An optional list of categories to include in the event.
- webDomains:
An optional list of web domains to include in the event. Some web domains have associated apps included implicitly.
- threshold:
The amount of time that results in a callback to a Deviceactivitymonitor.
Discussion
An application’s extension receives a callback once the combination of specified applications, categories, and webDomains have been in use longer than the event’s threshold within the activity’s scheduled interval. If your app didn’t specify any applications, categories, or webDomains, the event includes all applications, categories, and web domains.