【问题标题】:INInteraction donation duplicated in Spotlight IOS 12 Beta 5在 Spotlight IOS 12 Beta 5 中重复的 INInteraction 捐赠
【发布时间】: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


    【解决方案1】:

    这不是错误。当您将模拟器或 iPhone 设置为在开发人员部分显示最近的快捷方式时,这是默认行为。我只是被它弄糊涂了。

    不是重复,它只是为了开发而显示最新的而不是旧的

    【讨论】:

      猜你喜欢
      • 2013-11-26
      • 2014-12-01
      • 2011-03-09
      • 2013-03-29
      • 1970-01-01
      • 1970-01-01
      • 2010-10-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多