Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Homekit Feature #800

Open
daniarora17 opened this issue Aug 25, 2023 · 0 comments
Open

Homekit Feature #800

daniarora17 opened this issue Aug 25, 2023 · 0 comments
Assignees
Labels
feature request New feature or request

Comments

@daniarora17
Copy link

Why it is needed?

For react native, specifically for IOS, we do not see permission enablement for Homekit. In order to implement this there is a native implementation required.
Can anyone help in this

Possible implementation

Add Homekit module for IOS

Code sample

@objc(MyHomeKitModule)
class MyHomeKitModule: RCTBridgeModule {

    @objc func requestHomeKitPermission() {
        HMHomeManager.shared().requestHomeKitPermission { (success, error) in
            if success {
                // HomeKit permission has been granted.
            } else if let error = error {
                // HomeKit permission has been denied or an error occurred.
            }
        }
    }

    @objc func isHomeKitEnabled() -> Bool {
        return HMHomeManager.shared().isHomeKitEnabled
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants