INVoiceShortcutCenter.shared.getAllVoiceShortcuts does not return anything in iOS 13

别来无恙 提交于 2019-12-12 12:22:03

问题


I am not sure what I am doing wrong. But in this method

 INVoiceShortcutCenter.shared.getAllVoiceShortcuts { (vShortCuts, error) in
        print(vShortCuts)

    }

vShortCuts is an empty array.

var suggestions = [INShortcut]()
let userActivity = NSUserActivity.init(activityType: "com.riyaz.testactivity")
userActivity.title = "test activity"
let shortCut =  INShortcut.init(userActivity: userActivity)
suggestions.append(shortCut)

INVoiceShortcutCenter.shared.setShortcutSuggestions(suggestions)

I donated a suggestion Opened "Shortcuts app". Navigated to Gallery and Added the suggestion to Siri with a text.

However, The same text does not trigger the appdelegate's willContinueUserActivity

And also INVoiceShortcutCenter.shared.getAllVoiceShortcuts returns an empty array.

Any help appriciated.

来源:https://stackoverflow.com/questions/56884855/invoiceshortcutcenter-shared-getallvoiceshortcuts-does-not-return-anything-in-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!