Homekit Reset Configuration - homes don't get removed upon app re-entry

After a user goes to Settings>Privacy>HomeKit and resets Homekit Configuration, once the user re-enters the Homekit app, the Homekit app should remove all data about the removed homes.

I am having problems getting this to work consistently.

In order to remove the homes upon app re-entry, I am following the instructions found in "Observing HomeKit Database Changes", section "Observing Changes to the Collection of Homes", found at: https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/HomeKitDeveloperGuide/RespondingtoHomeKitDatabaseChanges/RespondingtoHomeKitDatabaseChanges.html

Just as that page says to, in methods appDelegate's homeManagerDidUpdateHomes and homeManagerDidUpdatePrimaryHome, I am sending out messages to be received by any visible viewcontrollers, so that they may close themselves, clear data, etc.

To debug, I've put breakpoints into those methods.

When I re-enter the app after resetting configuration, sometimes those methods are not called. But often they are! Does anyone know why I am not getting these methods called consistently after homekit reset configuration?

To make matters worse, in this case where these methods don't get called, if I continue using the app, the app continues to access the shared homeStore variable:

var homeStore: HomeStore {

return HomeStore.sharedStore

}

(As you can see, I'm using the HomeStore singleton class from HMCatalog code.)

And in this case, the value of homeStore.homeManager.homes value hasn't changed, and the value of homeStore.homeManager.primaryHome hasn't changed either...

In addition, the HMCatalog sample code doesn't appear to have this ability to reset itself upon homekit reset configuration.... so I don't believe I have any good reference to rely upon...

Does anyone have any thoughts on what the cause of either issue might be?

Any help would be greatly appreciated!

Thank you!

~Sean

Homekit Reset Configuration - homes don't get removed upon app re-entry
 
 
Q