Our application has two types of devices and both have the HomeKit integration but after HomeKit application we are doing Wifi provisioning with two different methods. Before iOS-13, all are working good but in iOS-13 there is some issue with the accessory name.
In iOS-12, the accessory name is constant so we are comparing that to the different framework like ExternalAccessory and NetService name and everything was working fine.
Basic workflow:
Step 1. Add the device in Apple HomeKit application
Step 2. Open our app and get all the accessories
for home in homeManager.homes {
for accessory in home.accessories {
//Some logic
}
}Step 3. Filter for our accessories only
Step 4. Select accessory for Wifi provisioning
Step 5. Start EAWiFiUnconfiguredAccessoryBrowser to get the accessory list
Step 6. Get the accessories in delegate method
func accessoryBrowser(_ browser: EAWiFiUnconfiguredAccessoryBrowser, didFindUnconfiguredAccessories accessories: Set)Here, in EAWiFiUnconfiguredAccessoryBrowser delegate, the accessory name is different compare to HMAccessory so its not possible to get the same device from HomeKit list and do Wifi Provisioning.
In iOS-12, the accessory has the unique name so we can compare that with EAWiFiUnconfiguredAccessory but in iOS-13, for all the devices it shows “Smoke Detector” or “Smoke Alarm”.
The same problem we are having with the different device which uses the NetServiceBrowser for the wifi-provisioning.
func netServiceBrowser(_ browser: NetServiceBrowser, didFind service: NetService, moreComing: Bool)Here also, NetService object gives the same name as EAWiFiUnconfiguredAccessory which is different from the HMAccessory object so it can not be compared. Also, there aren’t any other key/object which is same so there is no way that we can compare the HomeKit accessory with Wifi-Provisioning accessories.