How to detect if your custom Call Directory extension is enabled?

832 views Asked by At

I am developing a custom Call Directory extension on iOS 13. I like the containing app to display a nondisruptive message so the user is aware the extension is not currently enabled with a quick hyperlink to the Settings-app so it can enable it quick and easy. However I can't find the API that does this.

1

There are 1 answers

1
SierraMike On BEST ANSWER

Use CXCallDirectoryManager and the method

func getEnabledStatusForExtension(withIdentifier identifier: String, 
                completionHandler completion: @escaping (CXCallDirectoryManager.EnabledStatus, Error?) -> Void)

to see if your extension is enabled with the specific identifier for your extension. Result returns if state is unknown, enabled, or disabled.

Edit Mark: To complete the answer. To open the Settings-app use:

CXCallDirectoryManager.sharedInstance.openSettings { (error) in
    print("Open Settings")
}