1

我不明白这一点。突然,我无法使用 iOS 9.0 中引入的 UIUserNotificationActionResponseTypedTextKey 标识符来访问通知中的文本输入消息。Xcode 7.1 说:“UIUserNotificationActionResponseTypedTextKey 不可用”。

但我可以在 UIUserNotificationeSettings.h 中看到这个值。

在 Watchos2.0 我有这个值。

有任何想法吗?

在此处输入图像描述

4

1 回答 1

1

我在Xcode 7.2的发布版本中看到了同样的东西。UIUserNotificationActionResponseTypedTextKey我没有使用密钥,而是使用字符串版本“ UIUserNotificationActionResponseTypedTextKey”让它工作。

所以对我来说,这就是诀窍:

if let response = responseInfo["UIUserNotificationActionResponseTypedTextKey"] as? String {
     // Your code here
}
于 2016-02-04T02:38:15.240 回答