Nikita Zernov Nikita Zernov - 1 month ago 13
iOS Question

HomeKit: Check for permission

I have an iOS application using HomeKit and I need to check if application can access HomeKit Store. As I noticed,

homeManagerDidUpdateHomes
will be called anyway. How do I check for HomeKit store permission?

Answer

Edit: This apparently doesn't work anymore. Unfortunately, I'm not doing HK development anymore. See @windwalker's comment below for some info.

[[HMHomeManager alloc] init]

will return nil if you don't have access to the home. Other HomeKit inits will also return nil, that's just the one that I'm checking since it's the first thing that we try once the app loads.

Comments