Commit c70d2d97 authored by Jose Blaya's avatar Jose Blaya
Browse files

Fix Siri Shortcuts bug

parent 99666677
......@@ -197,7 +197,7 @@ class AppDelegate: NSObject, UIApplicationDelegate {
}
//MARK: Siri Shortcuts
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
if userActivity.activityType == AppConstants.SiriShortcuts.shortcutConnect {
if AppPreferences.shared.useConnectSiriShortcuts {
connectAfter(milliseconds: 200)
......
......@@ -1505,6 +1505,19 @@ extension SettingsViewController: INUIAddVoiceShortcutViewControllerDelegate {
extension SettingsViewController: INUIEditVoiceShortcutViewControllerDelegate {
func editVoiceShortcutViewController(_ controller: INUIEditVoiceShortcutViewController, didUpdate voiceShortcut: INVoiceShortcut?, error: Error?) {
if let error = error as? INIntentError {
if let errorDescription = error.userInfo["NSDebugDescription"] as? String,
let connectIdentifier = AppPreferences.shared.connectShortcut?.identifier.uuidString,
errorDescription.contains(connectIdentifier) {
AppPreferences.shared.useConnectSiriShortcuts = false
AppPreferences.shared.connectShortcut = nil
} else if let errorDescription = error.userInfo["NSDebugDescription"] as? String,
let disconnectIdentifier = AppPreferences.shared.disconnectShortcut?.identifier.uuidString,
errorDescription.contains(disconnectIdentifier) {
AppPreferences.shared.useDisconnectSiriShortcuts = false
AppPreferences.shared.disconnectShortcut = nil
}
}
dismiss(animated: true, completion: nil)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment