INInteraction 捐赠在 Spotlight IOS 12 Beta 5 中重复
INInteraction donation duplicated in Spotlight IOS 12 Beta 5
我正在捐赠一个 INInteraction,一切正常,但我不明白为什么捐赠在 Spotlight 中重复显示。
是否需要设置 属性 以防止出现这种情况??
let viewUsageIntent = UsageIntent()
var susbcribers = [INObject]()
for sub in account.subscribers {
let inObject = INObject(identifier: sub.phoneNumber, display: sub.id)
susbcribers.append(inObject)
}
viewUsageIntent.suggestedInvocationPhrase = phrase
viewUsageIntent.ban = account.ban
viewUsageIntent.subs = susbcribers
let interaction = INInteraction(intent: viewUsageIntent, response: nil)
interaction.donate(completion: {
error in
if let err = error {
MyAppServices.Logger.error(tag: "UsageIntentDonation", message: "Donation for ban \(account.ban) could not be completed: \(err.localizedDescription)")
}
})
有人在处理这个问题吗?谢谢
这不是错误。当您将模拟器或 iPhone 设置为在开发人员部分显示最近的快捷方式时,这是默认行为。我只是被它弄糊涂了。
不是重复,它只是为了开发而将最新的显示在旧的之上
我正在捐赠一个 INInteraction,一切正常,但我不明白为什么捐赠在 Spotlight 中重复显示。 是否需要设置 属性 以防止出现这种情况??
let viewUsageIntent = UsageIntent()
var susbcribers = [INObject]()
for sub in account.subscribers {
let inObject = INObject(identifier: sub.phoneNumber, display: sub.id)
susbcribers.append(inObject)
}
viewUsageIntent.suggestedInvocationPhrase = phrase
viewUsageIntent.ban = account.ban
viewUsageIntent.subs = susbcribers
let interaction = INInteraction(intent: viewUsageIntent, response: nil)
interaction.donate(completion: {
error in
if let err = error {
MyAppServices.Logger.error(tag: "UsageIntentDonation", message: "Donation for ban \(account.ban) could not be completed: \(err.localizedDescription)")
}
})
有人在处理这个问题吗?谢谢
这不是错误。当您将模拟器或 iPhone 设置为在开发人员部分显示最近的快捷方式时,这是默认行为。我只是被它弄糊涂了。
不是重复,它只是为了开发而将最新的显示在旧的之上