I would like to create HMHome with HMHomeManager and addHomeWithName.
manager.addHomeWithName("Casa", completionHandler:
{
(home:HMHome!, error:NSError!) in
if error != nil {
NSLog("Failed adding home, Error:\(error)")
} else {
NSLog("New Home \(home)")
}
})
When the application is run I am getting the following error instead of creating Home
Failed adding home, Error:Error Domain=NSCocoaErrorDomain Code=4097
"The operation couldn’t be completed. (Cocoa error 4097.)"
(connection to service named com.apple.homed.xpc)
I read than this problem can be solved switching "HomeKit" to "On" at the "Capabilities" tab. But I don't have a developer ID that is enrolled in a Developer Program.
There is any way to use this functionality without pay 80€/year?? I only want to learn... There is any way to enroll my Apple ID in free mode?
Thanks for all!!
Turning on "Homekit" on the capabilities tab says it will do three things -
You can't do 1 without the developer membership, but you can do 2 & 3 manually.
Unfortunately this still gave me the same error you received, until I enabled Homekit in capabilities, so it seems you will need to get a paid developer membership to work with Homekit