[TIMOB-23527] iOS10: Support the UserNotifications framework
GitHub Issue | n/a |
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-23T08:18:32.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.3.0 |
Components | iOS |
Labels | demo_app, ios10 |
Reporter | Hans Knöchel |
Assignee | Hans Knöchel |
Created | 2016-06-14T23:50:40.000+0000 |
Updated | 2018-08-06T17:57:27.000+0000 |
Description
iOS 10 offers a way to setup interactive notifications by using the UserNotifications
framework. We can configure notifications (UNNotification
), define notification actions (UNNotificationAction
), create notification content (UNNotificationContent
), add an attachment to a notification (UNNotificationAttachment
) and group them into categories (UNNotificationCategory
).
In addition, we can also trigger notifications (UNNotificationTrigger
) and manage notifications in the notification center (UNUserNotificationCenter
).
While some of it could be migrated to the existing ones, we should think about a new interface that manages those notifications properly.
Attachments
Ok, current status: I am trying to map the new API's to our existing API's as good as possible. That means, the
Ti.App.iOS.scheduleLocalNotification
will be the same as before, but calls the iOS 10 API's when using iOS 10. In addition, theTi.App.iOS.NotificationCategory
will useUNNotificationCategory
and it's notification actions defined inTi.App.iOS.NotificationAction
will useUNNotificationAction
. In addition to that, I would like to introduce the newTi.App.iOS.NotificationCenter
namespace, that could be used to schedule notification in both iOS < 10 and iOS 10, but also to control scheduled notifications etc. in iOS 10, since it exposes great utilities for that. Feedback greatly appreciated. A work-in-progress PR will come later today.PR (work in progress): https://github.com/appcelerator/titanium_mobile/pull/8078 I am trying to migrate everything that is available in iOS < 10. I am rewriting the whole notifications for iOS 10 and later having the same API-interface. In addition, certain properties like
subtitle
andattachments
are integrated in existing API's for iOS 10. Some new features coming with theUNUserNotificationCenter
will be integrated on theTi.App.iOS
namespace for now. Maybe we should consider introducing aTi.App.iOS.NotificationCenter
to make the public interface more structured and keep the internal code-base clean. //cc [~bgrantges@appcelerator.com] [~cng] [~ingo] *EDIT*: The plan is to finish the implementation by end of the week, add the docs until next Tuesday and keep it reviewed until next Friday. That should match the 6.0 code-freeze pretty good. But be aware that I currently use iOS 10 Beta 2, so there might be native interface changes that need to be validated before GA. I guess thats fine.That's fine. I'm all for introducing a
Ti.App.iOS.NotificationCenter
even though i rather prefer a parity API but, at this point we can consider parity at a later stage.Moving to 6.1.0, since the changes need way more testing then we have left for 6.0.0. Since we will be able to support both the old and the new notifications, that will be the proper way to go. The core-implementation is finished and parity-adjustments will be done over the next weeks.
Attached the first test-cases. One biggy is missing, the silent-push-notifications. I will setup a test-case and server-environment for that one as well. What we need to properly test this: - iOS 9 and 10 device - Titanium SDK 5.4.0.GA and Titanium master (once merged) - Real apps to test with (any cooperating partners / customers?) - A matrix of the results ([~htbryant] is good in those) I will submit the PR to review next in early October, after all my internal tests have succeeded.
Hans Knøchel, You asked for real app cooperating to test with. I could contribute with "real apps" testing. My app is this one: http://MoogliApp.com
Hey Tobias, thanks for that! As we want to move forward with 6.1.0 over the next weeks, I've put it out of 6.1.0 for now, since it requires major testing, so we won't break any push-related apps. Anyway, I would still love to give you a build if you want, so we can work on your specific test-cases together. Feel free to send me an email with further infos, thx!
[~vijaysingh] Ready for review!
Hey everyone! The pull request just landed in the core on master. Try it out today to ensure your specific use-cases are still working as before and make use of the new features like notification attachments! Install:
appc ti sdk install -b master
. Thanks!Cleaning up older fixed tickets from 2016 and earlier. If this ticket should not have been closed, please reopen it.