3

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.

Pavan Kumar
  • 63
  • 1
  • 6
  • How did you added ? i have same scenario. – Shrikant K Jun 18 '20 at 13:28
  • I would like to know how it works. Please let me know if you resolved, i'm trying to add it in same way i need to add it in background without opening native homekit camera. Thanks. – Shrikant K Jun 19 '20 at 10:40
  • Have added new question https://stackoverflow.com/questions/62470261/how-to-add-homekit-accessory-using-hmaccessorypayload – Shrikant K Jun 19 '20 at 12:29

0 Answers0