I'm trying to pair the Matter by calling HomeKit from within our app, I can successfully pair and the matter device is discovered via bonjour, but after the HomeKit pairing success callback, I can't get a similar UUID or other identifier.
I invoked HomeKit with the following code
- (void)addAccessoriesWithCompletion:(void (^)(NSError * _Nullable))completion {
if(@available(iOS 15.4, *)) {
HMAccessorySetupRequest *setupRequest = [[HMAccessorySetupRequest alloc] init];
setupRequest.homeUniqueIdentifier = self.currentHome.uniqueIdentifier;
[self.setupManager performAccessorySetupUsingRequest:setupRequest completionHandler:^(HMAccessorySetupResult * _Nullable result, NSError * _Nullable error) {
completion(error);
}];
}
else {
[self.currentHome addAndSetupAccessoriesWithCompletionHandler:completion];
}
}
- (HMAccessorySetupManager *)setupManager {
if (_setupManager == nil) {
_setupManager = [[HMAccessorySetupManager alloc] init];
}
return _setupManager;
}
HomeKit successfully added device delegate
- (void)home:(HMHome *)home didAddAccessory:(HMAccessory *)accessory {
if (self.homeDidAddAccessoryBlock) {
self.homeDidAddAccessoryBlock(accessory);
}
accessory.delegate = self;
}
Multiple matter devices may be discovered through bonjour, and I need to know which matter device I just added in order to bind to our user system.
So I need to get the device id from the HomeKit pairing success callback so I can filter the matter device.
Or do we need to set something on our matter firmware?