Skip to content
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-23527] iOS10: Support the UserNotifications framework #8078

Merged
merged 56 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f2230b8
[TIMOB-23527] Start to map notifications to iOS 10
hansemannn Jun 21, 2016
2032c2d
[TIMOB-23527] More work on iOS10 notifications
hansemannn Jul 18, 2016
f5e5e32
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Jul 18, 2016
dfefb17
[TIMOB-23527] Support notification attachments
hansemannn Jul 18, 2016
4ac7d9d
[TIMOB-23527] Support notification cancellation
hansemannn Jul 18, 2016
26e2b0e
[TIMOB-23527] Fix compatibility macros
hansemannn Jul 18, 2016
cf7624f
[TIMOB-23527] Support notification actions
hansemannn Jul 19, 2016
63c244e
[TIMOB-23527] Introduce user-notification-center
hansemannn Jul 19, 2016
ff65895
[TIMOB-23527] Migrate to Xcode Beta 3, change note
hansemannn Jul 19, 2016
cebea15
[TIMOB-23527] Cleanup, first docs
hansemannn Jul 19, 2016
9146294
[TIMOB-23527] Add more documentation / constants
hansemannn Jul 20, 2016
5499b9c
[TIMOB-23527] Clean-up response, wrap iOS10-stuff
hansemannn Jul 20, 2016
bc633f5
[TIMOB-23527] Fix compatibility macros
hansemannn Jul 20, 2016
91b9db5
[TIMOB-23527] Migrate more to notification center
hansemannn Jul 21, 2016
7e36b48
[TIMOB-23527] Ensure iOS < 10 compatibility
hansemannn Jul 22, 2016
257b5b9
[TIMOB-23527] Fix more legacy code-compatibility
hansemannn Jul 22, 2016
39ca685
[TIMOB-23527] Add NotificationCenter documentation
hansemannn Jul 22, 2016
fc8ed0d
[TIMOB-23527] Add SDK-side support for extensions
hansemannn Jul 23, 2016
33d22df
[TIMOB-23527] Fix threading issues
hansemannn Jul 23, 2016
571cd3d
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Aug 24, 2016
f5dd610
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Aug 27, 2016
716449b
[TIMOB-23527] Fix nil-crash, update more docs
hansemannn Aug 27, 2016
ce4d71c
[TIMOB-23527] Fix all memory-leaks in new proxies
hansemannn Aug 27, 2016
cd21858
[TIMOB-23527] Fix possible iOS < 10 leaks
hansemannn Aug 27, 2016
3aad1d2
[TIMOB-23527] Update docs to 6.1.0
hansemannn Oct 3, 2016
555c4ff
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Oct 3, 2016
dc15024
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Nov 17, 2016
59c8fd0
Merge branch 'master' into TIMOB-23527
hansemannn Mar 6, 2017
01ec397
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn Nov 20, 2017
1abff96
First stage of linting
hansemannn Nov 20, 2017
37a693e
Update docs
hansemannn Nov 20, 2017
8be344e
Resolve deprecations caused by merge
hansemannn Nov 20, 2017
11dbaa2
Fix warnings
hansemannn Nov 20, 2017
2e0a13b
Restore TiApp
hansemannn Nov 20, 2017
9d76105
Remove old statements
hansemannn Nov 20, 2017
8204526
Migrate more classes
hansemannn Nov 20, 2017
01e2acb
Fix typos, use DebugLog
hansemannn Nov 20, 2017
7b55306
More small fixes
hansemannn Nov 20, 2017
ac66417
Fix old docs
hansemannn Nov 20, 2017
b2a7e43
Fix docs errors
hansemannn Nov 20, 2017
9003290
Fix docs
hansemannn Nov 20, 2017
b39139d
Merge branch 'master' into TIMOB-23527
hansemannn Jan 21, 2018
f0f3fd8
Remove IS_XCODE_8 macro as min-xcode is 8.3 these days
hansemannn Jan 21, 2018
1895b9b
Fix some TODOs
hansemannn Jan 21, 2018
4565793
Merge branch 'master' into TIMOB-23527
hansemannn Mar 22, 2018
0214eb9
Use NSOrderedSet and NSInvocation for proper invocations
hansemannn Mar 22, 2018
7518f8a
Remove references to old methods
hansemannn Mar 22, 2018
5119683
Change „since“ versions to 7.2.0, fix a minor doc issue and lint sources
hansemannn Mar 22, 2018
7784f47
More improvements and docs
hansemannn Mar 22, 2018
f54fa40
Fix missing argument in silent push-selector
hansemannn Mar 23, 2018
2f3999d
Handle time-intervals in push notifications, always enable silent pis…
hansemannn Mar 23, 2018
cc3fd5f
[TIMOB-23527] Expose missing API’s, update a few docs
hansemannn Mar 24, 2018
9c96efa
Merge branch 'master' into TIMOB-23527
hansemannn Mar 24, 2018
459e839
Merge branch 'master' into TIMOB-23527
hansemannn May 14, 2018
add93ff
Fix review comments
hansemannn May 18, 2018
f1940eb
Merge branch 'master' of github.com:appcelerator/titanium_mobile into…
hansemannn May 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
216 changes: 216 additions & 0 deletions apidoc/Titanium/App/iOS/NotificationCenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
---
name: Titanium.App.iOS.NotificationCenter
summary: |
The top-level App iOS Notification Center module, available only to iOS devices running iOS 8 or later. It is
used to control scheduled notifications and receive details about the system-wide notification settings.

extends: Titanium.Module
platforms: [iphone, ipad]
osver: {ios: {min: "8.0"}}
since: "7.3.0"

methods:
- name: getPendingNotifications
summary: Fetches the pending notifications asynchronously.
parameters:
- name: callback
summary: |
The function that is being called after the notifications
have been fetched.
type: Callback<UserNotificationCallbackResponse>
since: "7.3.0"

- name: getDeliveredNotifications
summary: Fetches the delivered notifications asynchronously.
parameters:
- name: callback
summary: |
The function that is being called after the notifications
have been fetched.
type: Callback<UserNotificationCallbackResponse>
osver: {ios: {min: "10.0"}}
since: "7.3.0"

- name: removePendingNotifications
summary: |
Removes the specified pending notifications to prevent them from being triggered.
If no notifications are specified, all pending notifications will be removed.
since: "7.3.0"

- name: removeDeliveredNotifications
summary: |
Removes the specified delivered notifications from the notification-center.
If no notifications are specified, all delivered notifications will be removed.
osver: {ios: {min: "10.0"}}
since: "7.3.0"

- name: requestUserNotificationSettings
summary: |
Notification types and user notification categories the application is registered to use
(available on iOS 8 and later).
parameters:
- name: callback
summary: The callback invoked when requesting user notification settings.
type: Callback<GetUserNotificationSettings>
since: "7.3.0"

---
name: UserNotificationCallbackResponse
summary: |
Response when receiving pending or local notifications
in <Titanium.App.iOS.NotificationCenter.getPendingNotifications> and
<Titanium.App.iOS.NotificationCenter.getDeliveredNotifications>.
since: "7.3.0"
properties:
- name: notifications
type: Array<UserNotificationDictionary>
summary: An array of identifiers used to create notifications.

---
name: UserNotificationDictionary
summary: |
Dictionary of notification data used in the array of `notifications`
when receiving pending or local notifications in
<Titanium.App.iOS.NotificationCenter.getPendingNotifications> and
<Titanium.App.iOS.NotificationCenter.getDeliveredNotifications>.
since: "7.3.0"
properties:
- name: alertTitle
summary: Title of the notification.
type: String
osver: {ios: {min: "8.2"}}

- name: alertSubtitle
summary: Subtitle of the notification.
type: String
osver: {ios: {min: "10.0"}}

- name: alertAction
summary: |
Alert button text ('Open', by default) or home text ('Press Home to unlock', by default)
type: String
type: String

- name: alertBody
summary: Alert message.
type: String

- name: alertLaunchImage
summary: Image displayed instead of `Default.png` when launching the application.
type: String

- name: badge
summary: Application badge value.
type: Number

- name: date
summary: Date and time when the notification was configured to fire.
type: Date

- name: sound
summary: Path to the sound file configured to play when the notification was fired.
type: String

- name: timezone
summary: Timezone of the date when the notification was configured to fire.
type: String

- name: userInfo
summary: Custom data object.
type: Dictionary

- name: category
summary: Category identifier of the notification.
type: String
osver: {ios: {min: "8.0"}}

- name: identifier
summary: The notification identifier.
description: |
This property is required in iOS 10 and later and will fallback
to "notification" if not set.
optional: false
since: "7.3.0"
type: String

- name: region
summary: Region of the notification.
description: |
The following keys are included:
- latitude: The latitude of the region.
- longitude: The longitude of the region.
- radius: The radius of the region.
- identifier: The identifier of the region.
type: Dictionary
osver: {ios: {min: "10.0"}}

---
name: GetUserNotificationSettings
summary: |
Dictionary object of parameters used to register the application with local notifications using
the <Titanium.App.iOS.registerUserNotificationSettings> method.
platforms: [iphone, ipad]

properties:
- name: types
summary: Notification types to use.
description: |
Only available in iOS < 10. iOS 10 and later returns notification settings more detailed,
check the other attributes for more information.
type: Array<Number>
constants: Titanium.App.iOS.USER_NOTIFICATION_TYPE_*

- name: categories
summary: Set of categories of user notification actions required by the applicaiton to use.
type: Array<Titanium.App.iOS.UserNotificationCategory>
description: |
Only available in iOS < 10. iOS 10 and later returns notification settings more detailed,
check the other attributes for more information.

- name: authorizationStatus
summary: The current authorization status for using notifications.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_AUTHORIZATION_STATUS_*]
osver: {ios: {min: "10.0"}}

- name: soundSetting
summary: The current sound settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: badgeSetting
summary: The current badge settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: alertSetting
summary: The current alert settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: notificationCenterSetting
summary: The current notication-center settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: lockScreenSetting
summary: The current lock-screen settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: carPlaySetting
summary: The current CarPlay settings.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_SETTING_*]
osver: {ios: {min: "10.0"}}

- name: alertStyle
summary: The current alert style used to display notifications.
type: Number
constants: [Titanium.App.iOS.USER_NOTIFICATION_ALERT_STYLE_*]
osver: {ios: {min: "10.0"}}
28 changes: 28 additions & 0 deletions apidoc/Titanium/App/iOS/UserNotificationCategory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ properties:
summary: Array of notification actions to display for non-dialog-style notification.
description: |
If not specified, the first two actions from `actionsForDefaultContent` are displayed.
Note: This property has been removed in iOS 10. iOS 10+ will handle the actions internally.
type: Array<Titanium.App.iOS.UserNotificationAction>
accessors: false
osver: {ios: {max: 9.3}}
availability: creation

- name: identifier
Expand All @@ -48,3 +50,29 @@ properties:
accessors: false
availability: creation

- name: intentIdentifiers
summary: The intents related to notifications of this category.
description: |
When a notification is delivered, the presence of an intent identifier
lets the system know that the notification is potentially related to the
handling of a request made through Siri.
type: Array<String>
accessors: false
osver: {ios: {min: 10.0}}
availability: creation

- name: hiddenPreviewsBodyPlaceholder
summary: The placeholder text to display when notification previews are disabled for the app.
type: String
accessors: false
osver: {ios: {min: 11.0}}
availability: creation

- name: options
summary: Options for how to handle notifications of this type.
description: If not specified, defaults to <Titanium.App.iOS.USER_NOTIFICATION_CATEGORY_OPTION_NONE>.
type: Array<Number>
accessors: false
constants: [Titanium.App.iOS.USER_NOTIFICATION_CATEGORY_OPTION_*]
osver: {ios: {min: 10.0}}
availability: creation