测试测试过的 | ✓ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
发布最近发布 | 2015年8月 |
由alexruperez维护。
UIUserNotificationSettings-Extension提供了帮助方法,使你处理交互式通知变得更容易。
UIUserNotificationSettings+Extension.m
UIUserNotificationSettings+Extension.h
要运行示例项目,克隆仓库,然后从示例目录首先运行pod install
。
UIUserNotificationAction *openAction = [UIUserNotificationAction foregroundActionWithIdentifier:@"open_action" title:@"Open with alert 😉"];
UIUserNotificationAction *deleteAction = [UIUserNotificationAction backgroundDestructiveActionWithIdentifier:@"delete_action" title:@"Delete 😱" authenticationRequired:YES];
UIUserNotificationAction *okAction = [UIUserNotificationAction backgroundActionWithIdentifier:@"ok_action" title:@"Ok 👍" authenticationRequired:NO textInput:YES];
UIUserNotificationCategory *userNotificationCategory = [UIUserNotificationCategory categoryWithIdentifier:@"default_category" defaultActions:@[openAction, deleteAction, okAction] minimalActions:@[okAction, deleteAction]];
UIUserNotificationSettings *userNotificationSettings = [UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAll categoriesArray:@[userNotificationCategory]];
[[UIApplication sharedApplication] registerUserNotificationSettings:userNotificationSettings];
通过@alexruperez推文给作者,并查看alexruperez的博客:http://alexruperez.com
UIUserNotificationSettings-Extension在MIT许可证下可用。有关更多信息,请参阅LICENSE文件。