【发布时间】:2019-01-20 14:47:44
【问题描述】:
我正在捐赠 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)")
}
})
有人处理这个问题吗?谢谢。
【问题讨论】:
标签: swift4 beta spotlight ios12