init
TypeScriptstatic init(): MatterAddDeviceExtensionRequestHandlerSwift declarationoverride dynamic init()class · iOS 16.1+ · SDK 27.1
@objc class MatterAddDeviceExtensionRequestHandlerThe object that handles configuration and commissioning of a device into an ecosystem. This class facilitates the user interface flow during the setup of a new Matter device. Subclass this class and override its methods, except for ``MatterSupport/MatterAddDeviceExtensionRequestHandler/beginRequest(with:)``. The principal class for the app's extension declared by the <doc://com.apple.documentation/documentation/bundleresources/information_property_list/NSPrincipalClass> in the extension property list must inherit from this base class. If the ``MatterSupport/MatterAddDeviceRequest/Topology-swift.struct`` object in the request has two or more homes, the user interface flow displays a picker to allow selection of a home. If the object contains one home, that home is the selected home and the user interface flow doesn't display a picker. If the object contains no home, then the user interface flow doesn't display a picker, and any methods take a home parameter receive `nil`. - Note: Don't call `super` within the overridden method.
static init(): MatterAddDeviceExtensionRequestHandlerSwift declarationoverride dynamic init()commissionDevice(home: (MatterAddDeviceRequest_Home) | null, onboardingPayload: string, commissioningID: string): Promise<void>Swift declarationfunc commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throwsCommissions the device with the onboarding payload. - Parameters: - home: The selected home for the device. - onboardingPayload: The onboarding payload, as defined by Matter specification, that you need to use to commission the device. - commissioningID: A generated identifier you use with other MatterSupport methods.
validateDeviceCredential(deviceCredential: MatterAddDeviceExtensionRequestHandler_DeviceCredential): Promise<void>Swift declarationfunc validateDeviceCredential(_ deviceCredential: MatterAddDeviceExtensionRequestHandler.DeviceCredential) async throwsPerforms verification and attestation checks. Override this method to perform additional verification and attestation checks, which execute after Apple's built-in device attestation checks. If either attestation fails as indicated by an exception thrown here, a warning dialog appears before proceeding. > Note: If your app doesn't require any additional verification, leave this method un-implemented. This is the first callback that the system invokes during the setup flow. It runs after selecting a device but before commissioning, and can abort commissioning if the credential is rejected by throwing an exception.
configureDevice(name: string, room?: (MatterAddDeviceRequest_Room) | null): Promise<void>Swift declarationfunc configureDevice(named name: String, in room: MatterAddDeviceRequest.Room?) asyncConfigures the device with selected attributes. - Parameters: - name: The selected name for the device. - room: The selected room for the device.
selectWiFiNetwork(wifiScanResults: Array<MatterAddDeviceExtensionRequestHandler_WiFiScanResult>): Promise<MatterAddDeviceExtensionRequestHandler_WiFiNetworkAssociation>Swift declarationfunc selectWiFiNetwork(from wifiScanResults: [MatterAddDeviceExtensionRequestHandler.WiFiScanResult]) async throws -> MatterAddDeviceExtensionRequestHandler.WiFiNetworkAssociationProvides the visible Wi-Fi networks to the Matter device. This completion handler informs the device which Wi-Fi network it needs to join. The Matter device can provide information about the visible Wi-Fi networks that it sees, in order to provide the ability to choose the correct network on which to put the device. This method is a way for the ecosystem to choose the correct network for the device to use. The system may provide the selected Wi-Fi network in the completion handler. It must contain the credentials needed to associate to the selected network. The iOS device must be able to send the device IP traffic after it associates to the given network. Otherwise, if the return value is ``MatterAddDeviceExtensionRequestHandler/WiFiNetworkAssociation/defaultSystemNetwork``, the system attempts to use the current network to which this device is associated. iOS doesn't store any credentials. If the Matter device is already commissioned with a network, the selected network may do nothing. - Parameters: wifiScanResults: The networks that are visible to the device. - Returns: The Wi-Fi network to join, or ``MatterAddDeviceExtensionRequestHandler/WiFiNetworkAssociation/defaultSystemNetwork``.
selectThreadNetwork(threadScanResults: Array<MatterAddDeviceExtensionRequestHandler_ThreadScanResult>): Promise<MatterAddDeviceExtensionRequestHandler_ThreadNetworkAssociation>Swift declarationfunc selectThreadNetwork(from threadScanResults: [MatterAddDeviceExtensionRequestHandler.ThreadScanResult]) async throws -> MatterAddDeviceExtensionRequestHandler.ThreadNetworkAssociationProvides the visible Thread networks to the device. The Matter device provides information about the visible Thread networks that it sees. This allows the ecosystem to choose the correct network for the device to use. The system may provide the selected Thread network in the completion handler. The device commissions onto the specified network. The device must be able to send the device IP traffic after it associates to the given network. Otherwise, if the system returns ``MatterAddDeviceExtensionRequestHandler/ThreadNetworkAssociation/defaultSystemNetwork``, the device commissions onto the Preferred Thread network known to the device. Store credentials for the provided Thread network by calling <doc://com.apple.documentation/documentation/ThreadNetwork/THClient/3801788-storecredentials> before completing this callback. If the Matter device is already commissioned with a network, the selected network may do nothing. - Parameters: threadScanResults: The Thread networks visible to the device. - Returns: The Thread network to join, or ``MatterAddDeviceExtensionRequestHandler/ThreadNetworkAssociation/defaultSystemNetwork``.
rooms(home?: (MatterAddDeviceRequest_Home) | null): Promise<Array<MatterAddDeviceRequest_Room>>Swift declarationfunc rooms(in home: MatterAddDeviceRequest.Home?) async -> [MatterAddDeviceRequest.Room]Provides rooms that correspond to a home in the device setup. The system issues this request before presenting the "Select Room" card, and populates the picker with these options. If the returned array contains two or more rooms, the user-interface flow displays a picker to allow selection of a room. If the object contains one room, that room is the selected room and the user-interface flow doesn't display a picker. If the object contains no room, then the user-interface flow doesn't display a picker, and any methods that take a room parameter receive `nil`. - Parameters: home: The selected home for which the system is requesting rooms. - Returns: The list of rooms to show. If only one room exists, no room card appears.
No declarations were skipped in this snapshot.