Skip to content

HomeKit watchOS xcode13.3 beta1

Alex Soto edited this page Mar 7, 2022 · 2 revisions

#HomeKit.framework https://github.com/xamarin/xamarin-macios/pull/14325

diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupManager.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupManager.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupManager.h	2021-11-19 09:47:40.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupManager.h	2022-01-25 13:30:03.000000000 -0500
@@ -10,20 +10,45 @@
 
 NS_ASSUME_NONNULL_BEGIN
 
+@class HMAccessorySetupRequest;
+@class HMAccessorySetupResult;
 @class HMMatterTopology;
 
+/*!
+ *  @abstract   This class can be used to launch system UI that will allow the user to go through the process
+ *              of adding one or more accessories to a particular home and follow up with additional setup.
+ *              These APIs do not require that the current app has home data authorization
+ */
 HM_EXTERN API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(watchos, tvos) API_UNAVAILABLE(macos, macCatalyst)
 @interface HMAccessorySetupManager : NSObject
 
 /*!
- * @abstract Add and set up CHIP accessories with a CHIP Partner Ecosystem App. This flow is unique among the
- *           "Add Accessory" flows in that it primarily targets the originating (i.e. non-HomeKit) ecosystem
- *           to add accessories to. "Add to Apple Home?" is presented as a final, optional step after the user
- *           has completed pairing and configuration with the Partner Ecosystem App
+ *  @abstract   Launch system UI to perform the process of setting up accessories with the given request.
+ *              During this process, each of the accessories is added to a home, assigned to a room and
+ *              further configured based on its services
+ *
+ *  @param request A request object describing information about how to set up the accessory
+ *  @param completion A block that is invoked once the setup process finishes. On failure, the result will be
+ *                    nil and the error will provide additional information
+ */
+- (void)performAccessorySetupUsingRequest:(HMAccessorySetupRequest *)request completionHandler:(void(^)(HMAccessorySetupResult * _Nullable result, NSError * _Nullable error))completion API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(watchos, tvos);
+
+/*!
+ *  @abstract   Launch system UI to perform the process of setting up Matter accessories with a Matter Partner
+ *              Ecosystem App. This flow is different from other accessory setup flows in that it primarily
+ *              targets the ecosystem of the originating (i.e. non-HomeKit) app as the ecosystem to add
+ *              accessories to. The option to add to Apple Home is presented as a final, optional step after
+ *              the user has completed setup with the Matter Partner Ecosystem App
  *
- * @param topology  A configuration object representing the topology of the initiating ecosystem
+ *  @param request A request object describing information about how to set up the accessory
+ *  @param topology A configuration object representing the topology of the initiating ecosystem
+ *  @param completion A block that is invoked once the setup process finishes. The provided error will be nil
+ *                    on success or will provide additional information on failure
  */
-- (void)addAndSetUpAccessoriesForTopology:(HMMatterTopology *)topology completionHandler:(HMErrorBlock)completion;
+- (void)performMatterEcosystemAccessorySetupUsingRequest:(HMAccessorySetupRequest *)request
+                                                topology:(HMMatterTopology *)topology
+                                       completionHandler:(HMErrorBlock)completion API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(watchos, tvos);
+- (void)addAndSetUpAccessoriesForTopology:(HMMatterTopology *)topology completionHandler:(HMErrorBlock)completion API_DEPRECATED("Use -[HMAccessorySetupManager performAccessorySetupUsingRequest:topology:completionHandler:] instead", ios(15.0, 15.4));
 
 @end
 
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupRequest.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupRequest.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupRequest.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupRequest.h	2022-01-25 13:30:03.000000000 -0500
@@ -0,0 +1,49 @@
+//
+//  HMAccessorySetupRequest.h
+//  HomeKit
+//
+//  Copyright © 2021 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <HomeKit/HMDefines.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class HMAccessorySetupPayload;
+
+HM_EXTERN API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(watchos, tvos) API_UNAVAILABLE(macos, macCatalyst)
+@interface HMAccessorySetupRequest : NSObject <NSCopying>
+
+/*!
+ *  @abstract   The payload to use for accessory setup
+ *  @note       When this is non-nil, the following entitlement is required:
+ *                  com.apple.developer.homekit.allow-setup-payload
+ */
+@property (nullable, copy) HMAccessorySetupPayload *payload;
+
+/*!
+ *  @abstract   The -[HMHome uniqueIdentifier] that corresponds to the HMHome that the accessory should be
+ *              added to when being set up. If nil, then the user will be prompted to choose a home
+ */
+@property (nullable, copy) NSUUID *homeUniqueIdentifier;
+
+/*!
+ *  @abstract   The -[HMRoom uniqueIdentifier] that corresponds to the existing HMRoom that should be
+ *              suggested when the user is prompted to choose a room to add the accessory to. If nil, then any
+ *              room may be suggested
+ *  @note       This value will be ignored if homeUniqueIdentifier is nil
+ */
+@property (nullable, copy) NSUUID *suggestedRoomUniqueIdentifier;
+
+/*!
+ *  @abstract   The name that will be suggested when the user is prompted to name the accessory being set up.
+ *              If nil, then the suggested name will be taken from the accessory itself
+ *  @note       If an accessory bridge is being set up, then this value only applies to the accessory bridge
+ *              and not any accessories behind the bridge
+ */
+@property (nullable, copy) NSString *suggestedAccessoryName;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupResult.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupResult.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupResult.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMAccessorySetupResult.h	2022-01-25 13:30:05.000000000 -0500
@@ -0,0 +1,33 @@
+//
+//  HMAccessorySetupResult.h
+//  HomeKit
+//
+//  Created by Nick Fraioli on 7/12/21.
+//  Copyright © 2021 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+HM_EXTERN API_AVAILABLE(ios(15.4)) API_UNAVAILABLE(watchos, tvos) API_UNAVAILABLE(macos, macCatalyst)
+@interface HMAccessorySetupResult : NSObject <NSCopying>
+
+/*!
+ *  @abstract   The -[HMHome uniqueIdentifier] that the accessories were added to
+ */
+@property (readonly, copy) NSUUID *homeUniqueIdentifier;
+
+/*!
+ *  @abstract   The -[HMAccessory uniqueIdentifier] values corresponding to the accessories that were set up.
+ *              Usually only one accessory is set up at a time, but adding an accessory bridge can result in
+ *              multiple accessories being set up at once
+ */
+@property (readonly, copy) NSArray<NSUUID *> *accessoryUniqueIdentifiers;
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMHome.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMHome.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMHome.h	2021-11-19 10:24:27.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HMHome.h	2022-01-25 13:17:53.000000000 -0500
@@ -168,7 +168,7 @@
  *                   The NSError provides more information on the status of the request, error
  *                   will be nil on success.
  */
-- (void)addAndSetupAccessoriesWithCompletionHandler:(void (^)(NSError * __nullable error))completion API_AVAILABLE(ios(10.0)) API_UNAVAILABLE(macos, macCatalyst) API_UNAVAILABLE(watchos, tvos) NS_SWIFT_ASYNC_NAME(addAndSetUpAccessories());
+- (void)addAndSetupAccessoriesWithCompletionHandler:(void (^)(NSError * __nullable error))completion NS_SWIFT_ASYNC_NAME(addAndSetUpAccessories()) API_DEPRECATED("Use -[HMAccessorySetupManager performAccessorySetupUsingRequest:completionHandler:] instead", ios(10.0, 15.4)) API_UNAVAILABLE(macos, macCatalyst) API_UNAVAILABLE(watchos, tvos);
 
 /*!
  * @brief Add accessory with the given setup payload to the home.
@@ -179,7 +179,7 @@
  *                   The NSError provides more information on the status of the request, error
  *                   will be nil on success.
  */
-- (void)addAndSetupAccessoriesWithPayload:(HMAccessorySetupPayload *)payload completionHandler:(void (^)(NSArray<HMAccessory *>* __nullable accessories, NSError * __nullable error))completion API_AVAILABLE(ios(11.3)) API_UNAVAILABLE(macos, macCatalyst) API_UNAVAILABLE(watchos, tvos) NS_SWIFT_ASYNC_NAME(addAndSetUpAccessories(payload:));
+- (void)addAndSetupAccessoriesWithPayload:(HMAccessorySetupPayload *)payload completionHandler:(void (^)(NSArray<HMAccessory *>* __nullable accessories, NSError * __nullable error))completion NS_SWIFT_ASYNC_NAME(addAndSetUpAccessories(payload:)) API_DEPRECATED("Use -[HMAccessorySetupManager performAccessorySetupUsingRequest:completionHandler:] instead", ios(11.3, 15.0)) API_UNAVAILABLE(macos, macCatalyst) API_UNAVAILABLE(watchos, tvos);
 
 /*!
  * @brief True if this home supports all of the requirements for adding a network router.
diff -ruN /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HomeKit.h /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HomeKit.h
--- /Applications/Xcode_13.2.0.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HomeKit.h	2021-11-08 22:47:57.000000000 -0500
+++ /Applications/Xcode_13.3.0-beta.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HomeKit.framework/Headers/HomeKit.h	2022-01-19 00:12:23.000000000 -0500
@@ -42,7 +42,6 @@
 #import <HomeKit/HMEventTriggerActivationState.h>
 #import <HomeKit/HMSignificantEvents.h>
 #import <HomeKit/HMPresenceEventDefines.h>
-#import <HomeKit/HMAccessorySetupPayload.h>
 #import <HomeKit/HMAddAccessoryRequest.h>
 #import <HomeKit/HMNetworkConfigurationProfile.h>
 
@@ -62,7 +61,11 @@
 #import <HomeKit/HMCameraAudioControl.h>
 
 #import <HomeKit/HMAccessorySetupManager.h>
+#import <HomeKit/HMAccessorySetupPayload.h>
+#import <HomeKit/HMAccessorySetupRequest.h>
+#import <HomeKit/HMAccessorySetupResult.h>
+
 #import <HomeKit/HMMatterHome.h>
+#import <HomeKit/HMMatterRequestHandler.h>
 #import <HomeKit/HMMatterRoom.h>
 #import <HomeKit/HMMatterTopology.h>
-#import <HomeKit/HMMatterRequestHandler.h>
Clone this wiki locally