ioshomekit

HomeKit HMHome Users deprecated iOS9


In iOS8 HMHome had access to users, this does not work in iOS9, how do you know which users the home was shared with in iOS9?


Solution

  • You don't. The only available information is the access control the user has to the home, whether he/she is an administrator of the home or is a guest of a home (shared). Apple controls the list of users with its own dialog.

    You use this function to show Apple dialog

    manageUsersWithCompletionHandler(_: (NSError?) -> Void)
    

    where you can check the access the user has with this HMHome extension

    var isAdmin: Bool {
        return self.homeAccessControlForUser(currentUser).administrator
    }