【发布时间】:2018-12-25 04:13:41
【问题描述】:
我为 Siri 快捷方式创建了一个简单的意图,每当我尝试捐赠该意图时,都会出现以下错误。
交互捐赠失败:%@ Error Domain=IntentsErrorDomain Code=1901 "无法捐赠互动{ 意图 = { 用户 = ; 标识符 = 06DE1A38-6D46-4CB8-B825-3788E6A81420; }; dateInterval = <_nsconcretedateinterval:> (开始日期) 2018-07-17 12:38:39 +0000 + (持续时间) 0.000000 秒 = (结束 日期)2018-07-17 12:38:39 +0000; 意图响应 = ; 组标识符 = ; intentHandlingStatus = 未指定; 标识符 = F145FA84-7147-41A8-8698-681F06C8CEB5; 方向=未指定; } 意图没有有效的快捷方式类型” UserInfo={NSLocalizedDescription=无法捐赠交互 { 意图 = { 用户 = ; 标识符 = 06DE1A38-6D46-4CB8-B825-3788E6A81420; }; dateInterval = <_nsconcretedateinterval:> (开始日期) 2018-07-17 12:38:39 +0000 + (持续时间) 0.000000 秒 = (结束 日期)2018-07-17 12:38:39 +0000; 意图响应 = ; 组标识符 = ; intentHandlingStatus = 未指定; 标识符 = F145FA84-7147-41A8-8698-681F06C8CEB5; 方向=未指定; } 具有没有有效快捷方式类型的意图}
以下是我的意向捐赠代码
func donateInteraction() {
let intent = GetBalanceIntent()
intent.suggestedInvocationPhrase = "Get Balance"
let interaction = INInteraction(intent: intent, response: nil)
interaction.donate { (error) in
if error != nil {
if let error = error as NSError? {
print("Interaction donation failed: %@", error)
} else {
print("Successfully donated interaction")
}
}
}
}
【问题讨论】:
-
你能给我看看你的
.intentdefinition文件吗?一张就够了
标签: ios siri sirikit ios12 sirishortcuts