UAUserNotificationCategories Class Reference
Inherits from | NSObject |
Declared in | UAUserNotificationCategories.h |
Class Methods
createCategoriesFromFile:
Creates a set of categories from the specified .plist
file.
+ (NSSet *)createCategoriesFromFile:(NSString *)filePath
Parameters
- filePath
The path of the
.plist
file.
Return Value
A set of categories.
Discussion
Categories are defined in a plist dictionary with the category ID followed by an NSArray of user notification action definitions. The action definitions use the same keys as the properties on the action, with the exception of “foreground” mapping to either UIUserNotificationActivationModeForeground or UIUserNotificationActivationModeBackground. The required action definition title can be defined with either the “title” or “title_resource” key, where the latter takes precedence. If “title_resource” does not exist, the action definition title will fall back to the value of “title”. If the required action definition title is not defined, the category will not be created.
Example:
{ “category_id” : [ { “identifier” : “action ID”, “title_resource” : “action title resource”, “title” : “action title”, “foreground” : @YES, “authenticationRequired” : @NO, “destructive” : @NO }] }
Declared In
UAUserNotificationCategories.h
createCategory:actions:
Creates a user notification category with the specified ID and action definition.
+ (UAUserNotificationCategory *)createCategory:(NSString *)categoryId actions:(NSArray *)actionDefinitions
Parameters
- categoryId
The category identifier
- actionDefinitions
An array of user notification action dictionaries used to construct UIUserNotificationAction for the category.
Return Value
The user notification category created or nil
if an error occurred.
Declared In
UAUserNotificationCategories.h