iOS Homekit Error : Missing entitlement for API HomeKit

549 Views Asked by At

I am using HomeKit in my app for home automation and some time it throw this issue "Missing entitlement for API HomeKit". but not sure the exact reason of issue .

After google found some links where its mentioned that its due to "Homekit not accessible in background mode"

https://developer.apple.com/forums/thread/22279

https://developer.apple.com/forums/thread/70000

but I have tested it in background for 1 hour and it works . so I need to make sure it should also work in background mode as whole functionality is depended on background mode.

Even did not find any error which can explain its due to background mode. https://developer.apple.com/documentation/homekit/hmerror

same question is asked here but not answered yet Missing entitlement for API HomeKit

so it would be appreciated if some can help out here to get the exact cause of this issue.

Update

As per Apple HomeKit error list https://developer.apple.com/documentation/homekit/hmerror/code This error is due to not added entitlement https://developer.apple.com/documentation/homekit/hmerror/code/missingentitlement Here is detail "How to do that" https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_developer_homekit https://developer.apple.com/documentation/homekit/enabling_homekit_in_your_app

But I have already added this in entitlement for both development and release mode . But still its throwing same error confused me.

As my app successfully work for 30 mins in background so not sure what's the exact issue here . why its throwing this issue " Missing entitlement for API HomeKit "after testing app in background mode for more time

1

There are 1 best solutions below

3
On

You need to enable the HomeKit entitlements.
Choose your project in the project navigator. Select the target. Choose signing and capabilities, and click on +Capability Scroll down and add HomeKit

See below