Skip to content

Homekit Feature #800

@daniarora17

Description

@daniarora17

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
    }

}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions