ios - 如何在 iOS 8 的交互式通知中添加文本字段

标签 ios

我正在开发一个应用程序。这将有交互式通知。如果应用程序收到推送通知并且应用程序没有在前台运行,那么用户应该能够通过通知中心的通知进行回复。我想添加文本字段以从用户获取文本,并添加回复按钮以将该文本发送到应用程序。

知道怎么做吗?我可以通过 UIMutableNotificationAction 类添加按钮。但找不到添加文本字段的方法。

最佳答案

适用于 Xcode6 GM 和 iOS8 GM 版本。没有选项可以将文本字段添加到交互式**通知。

 NS_CLASS_AVAILABLE_IOS(8_0)
  @interface UIMutableUserNotificationAction : UIUserNotificationAction
  // The unique identifier for this action.
  @property (nonatomic, copy) NSString *identifier;

  // The localized title to display for this action.
  @property (nonatomic, copy) NSString *title;
  // How the application should be activated in response to the action.
  @property (nonatomic, assign) UIUserNotificationActivationMode activationMode;
  // Whether this action is secure and should require unlocking before being performed.    If the activation mode is UIUserNotificationActivationModeForeground, then the action is considered secure and this property is ignored.
  @property (nonatomic, assign, getter=isAuthenticationRequired) BOOL authenticationRequired;
  // Whether this action should be indicated as destructive when displayed.
  @property (nonatomic, assign, getter=isDestructive) BOOL destructive;
  @end

请参阅以下链接了解更多详细信息:

UIMutableUserNotificationAction

关于ios - 如何在 iOS 8 的交互式通知中添加文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25179758/

相关文章:

ios - iOS 应用程序错误 : Command/usr/bin/codesign failed with exit code 1

ios - 为什么括号会在 objective-c 中搞乱这个数学?

ios - 为什么 iOS 7 中 NavigationBar 和 TableView 的图标颜色不同?

iOS clocationmanager gmt 值

ios - 私有(private) iOS 应用

ios - session 存储在设备中不起作用

javascript - 如何始终显示ios底部浏览器栏

ios - 在 iOS 9 中从键盘隐藏剪切/粘贴面板

iphone - 是否可以通过编程方式从 iPhone 设备获取 radio 资源控制 (RRC) 状态?

ios - 如何通过 Swift 在拍摄的照片上插入文字?