You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/provider.markdown
+9-9Lines changed: 9 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -63,30 +63,30 @@ The `Provider` can continue to be used for sending notifications and the counter
63
63
64
64
## Class: apn.Provider
65
65
66
-
`apn.Provider` provides a number of methods for sending notifications, broadcasting notifications, and managing channels. Calling any of the methods will return a `Promise` for each notification and is discussed more in [Results from APN Provider Methods](#results-from-apnprovider-methods).
66
+
`apn.Provider` provides a number of methods for sending notifications, broadcasting notifications, and managing channels. Calling any of the methods will return a `Promise` for each notification, which is discussed more in [Results from APN Provider Methods](#results-from-apnprovider-methods).
67
67
68
68
### connection.send(notification, recipients)
69
69
70
-
This is the main interface for sending notifications. Create a `Notification` object and pass it in, along with a single recipient or an array of them and node-apn will take care of the rest, delivering a copy of the notification to each recipient.
70
+
This is the main interface for sending notifications. Create a `Notification` object and pass it in, along with a single recipient or an array of them, and node-apn will take care of the rest, delivering a copy of the notification to each recipient.
71
71
72
72
> A "recipient" is a `String` containing the hex-encoded device token.
73
73
74
74
Calling `send` will return a `Promise`. The Promise will resolve after each notification (per token) has reached a final state.
This is the interface for managing broadcast channels. Create a single `Notification` object or an aray of them and pass the notification(s) in, along with a bundleId, and an action (`create`, `read`, `readAll`, `delete`) and node-apn will take care of the rest, asking the APNs to perform the action using the criteria specified in each notification.
77
+
This is the interface for managing broadcast channels. Create a single `Notification` object or an array of them and pass the notification(s) in, along with a bundleId, and an action (`create`, `read`, `readAll`, `delete`) and node-apn will take care of the rest, asking the APNs to perform the action using the criteria specified in each notification.
78
78
79
-
> A "bundleId" is a `String` containing bundle identifier for the application.
79
+
> A "bundleId" is a `String` containing the bundle identifier for the application.
80
80
81
81
> An "action" is a `String` containing: `create`, `read`, `readAll`, or `delete` and represents what action to perform with a channel (See more in [Apple Documentation](https://developer.apple.com/documentation/usernotifications/sending-channel-management-requests-to-apns)).
82
82
83
83
Calling `manageChannels` will return a `Promise`. The Promise will resolve after each notification has reached a final state.
84
84
85
85
### connection.broadcast(notification, bundleId)
86
86
87
-
This is the interface for broadcasting Live Activity notifications. Create a single `Notification` object or an aray of them and pass the notification(s) in, along with a bundleId and node-apn will take care of the rest, asking the APNs to broadcast using the criteria specified in each notification.
87
+
This is the interface for broadcasting Live Activity notifications. Create a single `Notification` object or an array of them and pass the notification(s) in, along with a bundleId and node-apn will take care of the rest, asking the APNs to broadcast using the criteria specified in each notification.
88
88
89
-
> A "bundleId" is a `String` containing bundle identifier for the application.
89
+
> A "bundleId" is a `String` containing the bundle identifier for the application.
90
90
91
91
Calling `broadcast` will return a `Promise`. The Promise will resolve after each notification has reached a final state.
92
92
@@ -95,8 +95,8 @@ Calling `broadcast` will return a `Promise`. The Promise will resolve after each
95
95
Each notification can end in one of three possible states:
96
96
97
97
-`sent` - the notification was accepted by Apple for delivery to the given recipient
98
-
-`failed` (rejected) - the notification was rejected by Apple. A rejection has an associated `status` and `reason` which is included.
99
-
-`failed` (error) - a connection-level error occurred which prevented successful communication with Apple. In very rare cases it's possible that the notification was still delivered. However, this state usually results from a network problem.
98
+
-`failed` (rejected) - the notification was rejected by Apple. A rejection has an associated `status` and `reason` which are included.
99
+
-`failed` (error) - a connection-level error occurred, which prevented successful communication with Apple. In very rare cases, it's possible that the notification was still delivered. However, this state usually results from a network problem.
100
100
101
101
When the returned `Promise` resolves, its value will be an Object containing two properties
102
102
@@ -108,7 +108,7 @@ Being `sent` does **not** guarantee the notification will be _delivered_, other
108
108
109
109
#### failed
110
110
111
-
An array of objects for each failed token or bundle identifier. Each object will contain the device token or bundle identifier which failed and details of the failure which will differ between rejected and errored notifications.
111
+
An array of objects for each failed token or bundle identifier. Each object will contain the device token or bundle identifier that failed and details of the failure, which will differ between rejected and errored notifications.
112
112
113
113
For **rejected** notifications using `send()`, the object will take the following form
0 commit comments