New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Timob 17238 - iOS 8 Interactive Local Notifications #5988
Conversation
Added notificationAction and notificationCategory proxies Working for local notifications
Only when we don’t register it under background service. Then both delegates for foreground and background properly received and fired
push notifications support for interactive
Support for interactive notifications for local notifications. Also included for remote notifications but require update to ACS backend
@@ -61,6 +61,9 @@ methods: | |||
summary: The types of notifications required by the application separated by a bitwise-OR operator | |||
constants: Titanium.App.iOS.NOTIFICATION_TYPE_* | |||
type: Number | |||
- name: categories | |||
summary: The set of categories of user notification actions required by local and remote notifications | |||
type: NSSet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NSSet
is an Objective-C object. That should say "Array" instead
Code reviewed, good job. Please address comments and I will test it after. Thanks. |
Fixed coding style, documentation updated
updated copyright, and removed temporary test files
|
||
@interface TiAppiOSNotificationActionProxy : TiProxy { | ||
@private | ||
UIMutableUserNotificationAction *_notificationAction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to create a local variable if there's a retain
property
|
||
if([TiUtils isIOS8OrGreater]) { | ||
id category = [args objectForKey:@"category"]; | ||
if (category != nil) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure the category is a TiAppiOSNotificationCategoryProxy
PR reviewed, and new changes submitted by myself. We need another reviewer before it can be merged. |
Merging. |
Timob 17238 - iOS 8 Interactive Local Notifications
For iOS 8 or newer only.
Details: https://jira.appcelerator.org/browse/TIMOB-17238
New Feature:
Support for iOS 8 Interactive Local Notifications. Apple has added notification action support so that user can immediately handle notifications in the home screen or lock screen, without the user having to enter the app. To enable this for both local and remote notifications, the following steps have to followed:
Detailed Steps:
1. Create and Configure Notification Actions
key parameters:
activation Mode: NOTIFICATION_ACTIVATION_MODE_BACKGROUND, NOTIFICATION_ACTIVATION_MODE_FOREGROUND
determines where app should be activated when user selects this action
destructive: if this action does something permanent like delete
authenticationRequired: if this action needs user to enter pin to continue
2. Create and assign Notification Actions to Notification Categories
key parameters:
actionsForDefaultContext: default actions to show. Will show all if user has set app to display notifications in alert style.
actionsForMinimalContext(optional) : actions to show when user has set app to display notifications in banner style, and in lock screen.
3. Register the Notification Categories and Notification Types
Note: categories: nil will allow local notifications to work without actions
4. Add event listeners
Note: To enable interactive remote notifications, steps 1 to 3 should be done as well. Followed by Ti.Network.registerForPushNotifications. Require ACS to add additional field "category" to aps push packet, so that we can enable this for remote notifications.