Contents

ENManager

A class that manages exposure notifications.

Declaration

class ENManager

Overview

Before using an instance of this class, call activate(completionHandler:). If the completion handler completes successfully, you can work with the remaining properties and methods on the class. Activating this object doesn’t enable exposure notification; it only allows this object to be used. Once activated, exposure notification can be enabled with setExposureNotificationEnabled(_:completionHandler:), if needed.

If the app no longer needs an instance of this class, you must call invalidate(), which stops any outstanding operations and invokes the invalidation handler.

The framework invokes the invalidation handler once invalidation finishes, and performs the invocation exactly once, even if invalidate() is called multiple times. It does not call any additional handlers.

After calling invalidate(), your app can’t reuse the object. A new object must be created for subsequent use. The framework clears strong references once invalidation completes to break potential retain cycles. You don’t need to use weak references within your handlers to avoid retain cycles when using this class.

Topics

Activating the Manager

Obtaining Exposure Information

Obtaining Exposure Keys

Configuring the Manager

Preauthorizing Exposure Keys

Invalidating the Manager

Instance Properties

See Also

Essentials