问题
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