How to Add and Set up accessory using HMAccessoryPayLoad

817 views Asked by At

I want to know how to use

apple docs

func addAndSetupAccessories(with payload: HMAccessorySetupPayload, completionHandler completion: @escaping ([HMAccessory]?, Error?) -> Void)

I want to use this func because I need to pair HomeKit accessory without QR code or the HomeKit code. I want to pair the accessory through code.

the documentation of HMAccessorySetupPayload argument for the above function, it says it accepts URL for init.

I scanned QR-code for an accessory with QR code reader, it showed some type of URL as
X-HM://00671I5XXXXXX

can some help me how to pair the accessory with this function.

0

There are 0 answers