What's New / Connectivity & Hardware

What's new in ExposureNotification

~63 DeprecatediOS

ExposureNotification is Apple's framework for the COVID-19 exposure-notification system. It uses Bluetooth proximity detection to estimate contact with other devices, and reports and checks for potential exposures without recording identity or location.

This SDK deprecates 63 symbols and adds or removes nothing. The deprecations cover the error types ENErrorDomain, ENError, ENError.Code, and ENErrorOutType, plus attenuation constants including ENAttenuation and ENAttenuationMin. Behavior is unchanged; the deprecations mark the framework for retirement.

Deprecated

63
var

activityHandler

DeprecatediOS
open var activityHandler: ENActivityHandler?
DeprecatedNo longer supported.

Invoked when the app is launched for an activity while it might not be running. When the app is launched, it should create an ENManager instance, set this handler, and then activate the manager.

var

daysSinceLastExposureThreshold

DeprecatediOS
open var daysSinceLastExposureThreshold: Int
DeprecatedNo longer supported.

Exclude exposures with daysSinceLastExposure > this value. Defaults to 0 (don't filter).

var

daysSinceOnsetOfSymptoms

DeprecatediOS
open var daysSinceOnsetOfSymptoms: Int { get }
DeprecatedNo longer supported.

Number of days since the onset of symptoms. Defaults to ENDaysSinceOnsetOfSymptomsUnknown.

var

daySummaries

DeprecatediOS
open var daySummaries: [ENExposureDaySummary] { get }
DeprecatedNo longer supported.

Summary of each day containing an exposure.

func

detectExposures

DeprecatediOS
open func detectExposures(configuration: ENExposureConfiguration, completionHandler: @escaping ENDetectExposuresHandler) -> Progress
DeprecatedNo longer supported.

Detects exposures using the specified configuration to control the scoring algorithm. This uses the diagnosis keys already known to the system. Only available to apps with ENAPIVersion 2 or higher.

var

diagnosisKeysAvailableHandler

DeprecatediOS
open var diagnosisKeysAvailableHandler: ENDiagnosisKeysAvailableHandler?
DeprecatedNo longer supported.

Invoked after requestPreAuthorizedDiagnosisKeys if user authorization is still valid.

struct

ENActivityFlags

DeprecatediOS
public struct ENActivityFlags : OptionSet, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public struct ENActivityFlags : OptionSet, @unchecked Sendable {

    public init(rawValue: UInt32)

    /// Reserved field
    public static var reserved1: ENActivityFlags { get }

    /// Reserved field
    public static var reserved2: ENActivityFlags { get }

    /// The app launched in the background to perform periodic operations on iOS 12.5.
    public static var periodicRun: ENActivityFlags { get }

    /// The app launched in the foreground to display information about the pre-authorized key release
    public static var preAuthorizedKeyReleaseNotificationTapped: ENActivityFlags { get }
}
typealias

ENActivityHandler

DeprecatediOS
public typealias ENActivityHandler = (ENActivityFlags) -> Void
DeprecatedNo longer supported.

Invoked after the app is launched to report activities that occurred while the app might not be running.

typealias

ENAttenuation

DeprecatediOS
public typealias ENAttenuation = UInt8
DeprecatedNo longer supported.
var

ENAttenuationMax

DeprecatediOS
public var ENAttenuationMax: Int { get }
DeprecatedNo longer supported.
var

ENAttenuationMin

DeprecatediOS
public var ENAttenuationMin: Int { get }
DeprecatedNo longer supported.
enum

ENAuthorizationStatus

DeprecatediOS
public enum ENAuthorizationStatus : Int, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENAuthorizationStatus : Int, @unchecked Sendable {

    /// Authorization status has not yet been determined.
    	/// This status means the user has not been prompted yet. Using the API in this state may prompt the user.
    case unknown = 0

    /// This app is not authorized to use Exposure Notification. The user cannot change this app's authorization status.
    	/// This status may be due to active restrictions, such as parental controls being in place.
    case restricted = 1

    /// The user denied authorization for this app.
    case notAuthorized = 2

    /// The user has authorized this app to use Exposure Notification.
    case authorized = 3
}
enum

ENCalibrationConfidence

DeprecatediOS
public enum ENCalibrationConfidence : UInt8, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENCalibrationConfidence : UInt8, @unchecked Sendable {

    /// No calibration data.
    case lowest = 0

    /// Using average calibration over phones of this manufacturer or Android beacons from EN API version < 1.5.
    case low = 1

    /// Using single-antenna orientation for a similar phone model or iPhone beacons from EN API version < 1.5.
    case medium = 2

    /// Determined using significant calibration data for this model.
    case high = 3
}
typealias

ENDetectExposuresHandler

DeprecatediOS
public typealias ENDetectExposuresHandler = (ENExposureDetectionSummary?, (any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when detecting exposures completes. It provides a summary of exposures. If it completes successfully, summary will contain a summary of exposures and error will be nil. If it fails, summary will be nil and error indicates the reason it failed.

typealias

ENDiagnosisKeysAvailableHandler

DeprecatediOS
public typealias ENDiagnosisKeysAvailableHandler = ([ENTemporaryExposureKey]) -> Void
DeprecatedNo longer supported.
enum

ENDiagnosisReportType

DeprecatediOS
public enum ENDiagnosisReportType : UInt32, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENDiagnosisReportType : UInt32, @unchecked Sendable {

    /// Diagnosis type unknown or not available.
    case unknown = 0

    /// Confirmed test.
    case confirmedTest = 1

    /// Confirmed clinical diagnosis.
    case confirmedClinicalDiagnosis = 2

    /// User reported positive diagnosis without health authority involvement.
    case selfReported = 3

    /// Person determined to be positive based on exposure to another person confirmed to be positive. This report type
    	/// is reserved for future use and keys with this report type are not matched by iOS.
    case recursive = 4

    /// Negative test. This is mainly to negate a previous self report or clinical diagnosis that may have been in error.
    case revoked = 5
}
struct

ENError

DeprecatediOS
public struct ENError : CustomNSError, Hashable, Error
DeprecatedNo longer supported.
Declaration
public struct ENError : CustomNSError, Hashable, Error {

    public init(_nsError: NSError)

    public static var errorDomain: String { get }

    /// Error codes used with ENErrorDomain.
    @available(iOS, introduced: 12.5, deprecated: 27.0, message: "No longer supported.")
    public enum Code : Int, @unchecked Sendable, Equatable {

        /// Error codes used with ENErrorDomain.
        public typealias _ErrorType = ENError

        case unknown = 1

        /// Underlying failure with an unknown cause.
        case badParameter = 2

        /// Missing or incorrect parameter.
        case notEntitled = 3

        /// Calling process doesn't have the correct entitlement.
        case notAuthorized = 4

        /// User denied this process access to Exposure Notification functionality.
        case unsupported = 5

        /// Operation is not supported.
        case invalidated = 6

        /// Invalidate was called before the operation completed normally.
        case bluetoothOff = 7

        /// Bluetooth was turned off the by user.
        case insufficientStorage = 8

        /// Insufficient storage space to enable Exposure Notification.
        case notEnabled = 9

        /// Exposure Notification has not been enabled.
        case apiMisuse = 10

        /// The API was used incorrectly.
        case `internal` = 11

        /// Internal error. This indicates a bug in this framework.
        case insufficientMemory = 12

        /// Not enough memory to perform an operation.
        case rateLimited = 13

        /// API called too frequently. See API for acceptable frequency.
        case restricted = 14

        /// Exposure Notification is disabled due to system policies.
        case badFormat = 15

        /// File or data format problem.
        case dataInaccessible = 16

        /// The device must be unlocked before data is accessible.
        case travelStatusNotAvailable = 17
    }

    public static var unknown: ENError.Code { get }

    /// Underlying failure with an unknown cause.
    public static var badParameter: ENError.Code { get }

    /// Missing or incorrect parameter.
    public static var notEntitled: ENError.Code { get }

    /// Calling process doesn't have the correct entitlement.
    public static var notAuthorized: ENError.Code { get }

    /// User denied this process access to Exposure Notification functionality.
    public static var unsupported: ENError.Code { get }

    /// Operation is not supported.
    public static var invalidated: ENError.Code { get }

Truncated.

let

ENErrorDomain

DeprecatediOS
public let ENErrorDomain: String
DeprecatedNo longer supported.

NSError domain for Exposure Notification errors.

typealias

ENErrorHandler

DeprecatediOS
public typealias ENErrorHandler = ((any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when an operation completes. Error is nil for success or non-nil if an error occurred.

typealias

ENErrorOutType

DeprecatediOS
public typealias ENErrorOutType = AutoreleasingUnsafeMutablePointer<NSError?>
DeprecatedNo longer supported.

Type for returning NSError's from functions. Avoids long and repetitious method signatures.

typealias

ENGetDiagnosisKeysHandler

DeprecatediOS
public typealias ENGetDiagnosisKeysHandler = ([ENTemporaryExposureKey]?, (any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when getDiagnosisKeysWithCompletionHandler completes. If it completes successfully, keys will contain the Diagnosis Keys for this device and error will be nil. If it fails, keys will be nil and error indicates the reason it failed.

typealias

ENGetExposureInfoHandler

DeprecatediOS
public typealias ENGetExposureInfoHandler = ([ENExposureInfo]?, (any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when getting exposures completes. It provides info about each exposure. If it completes successfully, exposures will contain info about each exposure and error will be nil. If it fails, exposures will be nil and error indicates the reason it failed.

typealias

ENGetExposureWindowsHandler

DeprecatediOS
public typealias ENGetExposureWindowsHandler = ([ENExposureWindow]?, (any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when getExposureWindows completes. It provides info about each exposure window. If it completes successfully, exposureWindows will non-nil and error will be nil. If it fails, exposureWindows will be nil and error indicates the reason it failed.

typealias

ENGetUserTraveledHandler

DeprecatediOS
public typealias ENGetUserTraveledHandler = (Bool, (any Error)?) -> Void
DeprecatedNo longer supported.

Invoked when getUserTraveled completes.

enum

ENInfectiousness

DeprecatediOS
public enum ENInfectiousness : UInt32, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENInfectiousness : UInt32, @unchecked Sendable {

    case none = 0

    /// Never returned through the API, but used for configuration.
    case standard = 1

    /// Never returned through the API, but used for configuration.
    case high = 2
}
typealias

ENIntervalNumber

DeprecatediOS
public typealias ENIntervalNumber = UInt32
DeprecatedNo longer supported.
typealias

ENRiskLevel

DeprecatediOS
public typealias ENRiskLevel = UInt8
DeprecatedNo longer supported.
var

ENRiskLevelMax

DeprecatediOS
public var ENRiskLevelMax: Int { get }
DeprecatedNo longer supported.
var

ENRiskLevelMin

DeprecatediOS
public var ENRiskLevelMin: Int { get }
DeprecatedNo longer supported.
typealias

ENRiskLevelValue

DeprecatediOS
public typealias ENRiskLevelValue = UInt8
DeprecatedNo longer supported.
var

ENRiskLevelValueMax

DeprecatediOS
public var ENRiskLevelValueMax: Int { get }
DeprecatedNo longer supported.
var

ENRiskLevelValueMin

DeprecatediOS
public var ENRiskLevelValueMin: Int { get }
DeprecatedNo longer supported.
typealias

ENRiskScore

DeprecatediOS
public typealias ENRiskScore = UInt8
DeprecatedNo longer supported.
var

ENRiskScoreMax

DeprecatediOS
public var ENRiskScoreMax: Int { get }
DeprecatedNo longer supported.
var

ENRiskScoreMin

DeprecatediOS
public var ENRiskScoreMin: Int { get }
DeprecatedNo longer supported.
var

ENRiskWeightDefault

DeprecatediOS
public var ENRiskWeightDefault: Int { get }
DeprecatedNo longer supported.
var

ENRiskWeightDefaultV2

DeprecatediOS
public var ENRiskWeightDefaultV2: Int { get }
DeprecatedNo longer supported.
var

ENRiskWeightMax

DeprecatediOS
public var ENRiskWeightMax: Int { get }
DeprecatedNo longer supported.
var

ENRiskWeightMaxV2

DeprecatediOS
public var ENRiskWeightMaxV2: Int { get }
DeprecatedNo longer supported.
var

ENRiskWeightMin

DeprecatediOS
public var ENRiskWeightMin: Int { get }
DeprecatedNo longer supported.
enum

ENStatus

DeprecatediOS
public enum ENStatus : Int, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENStatus : Int, @unchecked Sendable {

    /// Status of Exposure Notification is unknown. This is the status before ENManager has activated successfully.
    case unknown = 0

    /// Exposure Notification is active on the system.
    case active = 1

    /// Exposure Notification is disabled. setExposureNotificationEnabled:completionHandler can be used to enable it.
    case disabled = 2

    /// Bluetooth has been turned off on the system. Bluetooth is required for Exposure Notification.
    	/// Note: this may not match the state of Bluetooth as reported by CoreBluetooth.
    	/// Exposure Notification is a system service and can use Bluetooth in situations when apps cannot.
    	/// So for the purposes of Exposure Notification, it's better to use this API instead of CoreBluetooth.
    case bluetoothOff = 3

    /// Exposure Notification is not active due to system restrictions, such as parental controls.
    	/// When in this state, the app cannot enable Exposure Notification.
    case restricted = 4

    /// For future use. Not returned by any APIs yet.
    case paused = 5

    /// Exposure Notification is not available due to insufficient authorization.
    case unauthorized = 6
}
enum

ENVariantOfConcernType

DeprecatediOS
public enum ENVariantOfConcernType : UInt32, @unchecked Sendable
DeprecatedNo longer supported.
Declaration
public enum ENVariantOfConcernType : UInt32, @unchecked Sendable {

    case typeUnknown = 0

    case type1 = 1

    case type2 = 2

    case type3 = 3

    case type4 = 4
}
func

getExposureWindows

DeprecatediOS
open func getExposureWindows(summary: ENExposureDetectionSummary, completionHandler: @escaping ENGetExposureWindowsHandler) -> Progress
DeprecatedNo longer supported.

Gets info about each exposure window from the summary provided when exposure detection completes.

func

getUserTraveled

DeprecatediOS
open func getUserTraveled(completionHandler: @escaping @Sendable (Bool, (any Error)?) -> Void)
DeprecatedNo longer supported.

Reports if the user traveled within an exposure period (e.g. 14 days).

var

immediateDurationWeight

DeprecatediOS
open var immediateDurationWeight: Double
DeprecatedNo longer supported.

Weights to apply to durations at each proximity level based on attenuation. Range is 0-250%.

var

infectiousnessForDaysSinceOnsetOfSymptoms

DeprecatediOS
open var infectiousnessForDaysSinceOnsetOfSymptoms: [NSNumber : NSNumber]?
DeprecatedNo longer supported.

Maps daysSinceOnsetOfSymptoms to infectiousness. Must be configured if using V2 scoring. Key is a daysSinceOnsetOfSymptoms: -14 to 14. Value is an ENInfectiousness. Defaults to ENInfectiousnessNone for days not specified. If a value is set to ENInfectiousnessNone, diagnosis keys for it should be ignored.

var

infectiousnessHighWeight

DeprecatediOS
open var infectiousnessHighWeight: Double
DeprecatedNo longer supported.
var

infectiousnessStandardWeight

DeprecatediOS
open var infectiousnessStandardWeight: Double
DeprecatedNo longer supported.

Weights to apply for infectiousness. Range is 0-250%.

var

mediumDurationWeight

DeprecatediOS
open var mediumDurationWeight: Double
DeprecatedNo longer supported.
var

nearDurationWeight

DeprecatediOS
open var nearDurationWeight: Double
DeprecatedNo longer supported.
var

otherDurationWeight

DeprecatediOS
open var otherDurationWeight: Double
DeprecatedNo longer supported.
func

preAuthorizeDiagnosisKeys

DeprecatediOS
open func preAuthorizeDiagnosisKeys(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
DeprecatedNo longer supported.

Authorizes a one-time, future release of diagnosis keys without a user prompt at the time of release. This allows the user to authorize ahead of time in case they are unable to approve at the time of positive diagnosis. WARNING: Application should be in foreground to request the authorization

func

preAuthorizeDiagnosisKeys

DeprecatediOS
open func preAuthorizeDiagnosisKeys() async throws
DeprecatedNo longer supported.

Authorizes a one-time, future release of diagnosis keys without a user prompt at the time of release. This allows the user to authorize ahead of time in case they are unable to approve at the time of positive diagnosis. WARNING: Application should be in foreground to request the authorization

var

reportTypeConfirmedClinicalDiagnosisWeight

DeprecatediOS
open var reportTypeConfirmedClinicalDiagnosisWeight: Double
DeprecatedNo longer supported.
var

reportTypeConfirmedTestWeight

DeprecatediOS
open var reportTypeConfirmedTestWeight: Double
DeprecatedNo longer supported.

Weights to apply for each report type. Range is 0-250%.

var

reportTypeNoneMap

DeprecatediOS
open var reportTypeNoneMap: ENDiagnosisReportType
DeprecatedNo longer supported.

Maps scenarios when Report Type is not present into one of the available report types. If this is set to ENDiagnosisReportTypeUnknown, the key will be ignored if it does not contain a report type.

var

reportTypeRecursiveWeight

DeprecatediOS
open var reportTypeRecursiveWeight: Double
DeprecatedNo longer supported.
var

reportTypeSelfReportedWeight

DeprecatediOS
open var reportTypeSelfReportedWeight: Double
DeprecatedNo longer supported.
func

requestPreAuthorizedDiagnosisKeys

DeprecatediOS
open func requestPreAuthorizedDiagnosisKeys(completionHandler: @escaping @Sendable ((any Error)?) -> Void)
DeprecatedNo longer supported.

Requests diagnosis keys after previously using preAuthorizeDiagnosisKeys successfully. This will display a notification to the user for the user to know the keys will be returned. Keys are returned by invoking diagnosisKeysAvailable, which must be set before calling this.

func

requestPreAuthorizedDiagnosisKeys

DeprecatediOS
open func requestPreAuthorizedDiagnosisKeys() async throws
DeprecatedNo longer supported.

Requests diagnosis keys after previously using preAuthorizeDiagnosisKeys successfully. This will display a notification to the user for the user to know the keys will be returned. Keys are returned by invoking diagnosisKeysAvailable, which must be set before calling this.

func

userTraveled

DeprecatediOS
open func userTraveled() async throws -> Bool
DeprecatedNo longer supported.

Reports if the user traveled within an exposure period (e.g. 14 days).

var

variantOfConcernType

DeprecatediOS
open var variantOfConcernType: ENVariantOfConcernType { get }
DeprecatedNo longer supported.

Type of variant of concern

enum

ENError.Code

DeprecatediOS
public enum Code : Int, @unchecked Sendable, Equatable
DeprecatedNo longer supported.

Error codes used with ENErrorDomain.

Declaration
public enum Code : Int, @unchecked Sendable, Equatable {

    /// Error codes used with ENErrorDomain.
    public typealias _ErrorType = ENError

    case unknown = 1

    /// Underlying failure with an unknown cause.
    case badParameter = 2

    /// Missing or incorrect parameter.
    case notEntitled = 3

    /// Calling process doesn't have the correct entitlement.
    case notAuthorized = 4

    /// User denied this process access to Exposure Notification functionality.
    case unsupported = 5

    /// Operation is not supported.
    case invalidated = 6

    /// Invalidate was called before the operation completed normally.
    case bluetoothOff = 7

    /// Bluetooth was turned off the by user.
    case insufficientStorage = 8

    /// Insufficient storage space to enable Exposure Notification.
    case notEnabled = 9

    /// Exposure Notification has not been enabled.
    case apiMisuse = 10

    /// The API was used incorrectly.
    case `internal` = 11

    /// Internal error. This indicates a bug in this framework.
    case insufficientMemory = 12

    /// Not enough memory to perform an operation.
    case rateLimited = 13

    /// API called too frequently. See API for acceptable frequency.
    case restricted = 14

    /// Exposure Notification is disabled due to system policies.
    case badFormat = 15

    /// File or data format problem.
    case dataInaccessible = 16

    /// The device must be unlocked before data is accessible.
    case travelStatusNotAvailable = 17
}

No APIs match your filter.

← More in Connectivity & Hardware