ANCS: provide way to respond to notification with text input from user
| Originator: | martijn | ||
| Number: | rdar://21324176 | Date Originated: | 10-Jun-2015 08:28 PM |
| Status: | Open | Resolved: | No |
| Product: | iOS | Product Version: | 9.0 beta 1 |
| Classification: | Enhancement | Reproducible: | N/A |
Summary:
iOS 9 added a number of APIs to allow 3rd party (non-Apple) apps to accept text input from the user as response to a notification (see API header below).
ANCS is currently only capable of delivering notifications to the user. It can also take one, predefined action on them ("Clear"). Now that iOS 9 allows apps to accept textual responses, it's time for ANCS to take the next step as well and provide a way for users to input a textual response into an ANCS-enabled accessory and have ANCS relay it to the right app.
The relevant, newly added iOS 9.0 beta 1 APIs:
UIUserNotificationActionBehavior (from UIUserNotificationSettings.h)
typedef NS_ENUM(NSUInteger, UIUserNotificationActionBehavior) {
UIUserNotificationActionBehaviorDefault, // the default action behavior
UIUserNotificationActionBehaviorTextInput // system provided action behavior, allows text input from the user
} NS_ENUM_AVAILABLE_IOS(9_0);
UIKIT_EXTERN NSString *const UIUserNotificationTextInputActionButtonTitleKey NS_AVAILABLE_IOS(9_0);
UIKIT_EXTERN NSString *const UIUserNotificationActionResponseTypedTextKey NS_AVAILABLE_IOS(9_0);
// The behavior of this action when the user activates it.
@property (nonatomic, assign, readonly) UIUserNotificationActionBehavior behavior NS_AVAILABLE_IOS(9_0);
// Parameters that can be used by some types of actions.
@property (nonatomic, copy, readonly) NSDictionary *parameters NS_AVAILABLE_IOS(9_0);
And from UIApplication.h:
- (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void(^)())completionHandler NS_AVAILABLE_IOS(9_0);
- (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void(^)())completionHandler NS_AVAILABLE_IOS(9_0);
Steps to Reproduce:
N/A
Expected Results:
N/A
Actual Results:
N/A
Version:
iOS 9 beta 1 (13A4254v)
Notes:
Configuration:
iPhone 5 (A1429)
Attachments:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!