Skip to content

Commit 48de95d

Browse files
authored
docs: Add how to configure watchOS push notifications (#956)
1 parent bbf1ec2 commit 48de95d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

_includes/parse-server/push-notifications.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Push Notifications
22

3-
Parse Server provides basic push notification functionality for iOS, macOS, tvOS and Android. With this feature, you can:
3+
Parse Server provides basic push notification functionality for iOS, macOS, tvOS, watchOS<sup>*</sup>, and Android. With this feature, you can:
44

55
* Target installations by platform
66
* Target installations by a `ParseQuery`
77
* Send push notifications to Android devices through [Firebase Cloud Messaging (FCM)](https://firebase.google.com/docs/cloud-messaging/)
8-
* Send push notifications to iOS, tvOS and macOS devices through [Apple Push Notification Service (APNS)](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1)
8+
* Send push notifications to iOS, tvOS, watchOS, and macOS devices through [Apple Push Notification Service (APNS)](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/APNSOverview.html#//apple_ref/doc/uid/TP40008194-CH8-SW1)
99
* Use most of the sending options
1010

1111
However, there are a few caveats:
@@ -15,6 +15,8 @@ However, there are a few caveats:
1515
* Delivery reports are not supported
1616
* Scheduled push is not supported
1717

18+
<sup>*</sup>Sending notifications to watchOS devices requires [parse-server-push-adapter](https://github.com/parse-community/parse-server-push-adapter) >= 6.10.0.
19+
1820
## API
1921
We support most of the sending options. Check the detailed doc [here]({{ site.baseUrl }}/rest/guide/#sending-options). Parse Server supports the following:
2022

@@ -44,7 +46,7 @@ You will need to obtain some credentials from FCM and APNS in order to send push
4446

4547
#### APNS (iOS)
4648

47-
If you are setting up push notifications on iOS, tvOS or macOS for the first time, we recommend you visit the [raywenderlich.com's Push Notifications tutorial](https://www.raywenderlich.com/11395893-push-notifications-tutorial-getting-started) or [appcoda.com's iOS Push tutorial](https://www.appcoda.com/push-notification-ios/) to help you obtain a production Apple Push Certificate. Parse Server supports the PFX (`.p12`) file exported from Keychain Access. Parse Server also supports the push certificate and key in `.pem` format. Token-based authentication instead of a certificate is supported as well.
49+
If you are setting up push notifications on iOS, tvOS, watchOS, or macOS for the first time, we recommend you visit the [raywenderlich.com's Push Notifications tutorial](https://www.raywenderlich.com/11395893-push-notifications-tutorial-getting-started) or [appcoda.com's iOS Push tutorial](https://www.appcoda.com/push-notification-ios/) to help you obtain a production Apple Push Certificate. Parse Server supports the PFX (`.p12`) file exported from Keychain Access. Parse Server also supports the push certificate and key in `.pem` format. Token-based authentication instead of a certificate is supported as well.
4850

4951
#### FCM (Android)
5052

@@ -127,13 +129,16 @@ push: {
127129
tvos: [
128130
// ...
129131
],
132+
watchos: [
133+
// ...
134+
],
130135
osx: [
131136
// ...
132137
]
133138
}
134139
```
135140

136-
The configuration for macOS and tvOS works exactly as for iOS. Just add an additional configuration for each platform under the appropriate key. Please note the key for macOS is `osx` and for tvOS is `tvos`. If you need to support both the dev and prod certificates, you can do that for all Apple platforms like described above.
141+
The configuration for macOS, tvOS, and watchOS works exactly as for iOS. Just add an additional configuration for each platform under the appropriate key. Please note the key for macOS is `osx`, the key for tvOS is `tvos`, and the key for watchOS is `watchos`. If you need to support both the dev and prod certificates, you can do that for all Apple platforms like described above.
137142

138143
```js
139144
var server = new ParseServer({
@@ -162,6 +167,12 @@ var server = new ParseServer({
162167
passphrase: '', // optional password to your p12/PFX
163168
bundleId: '',
164169
production: false
170+
},
171+
watchos: {
172+
pfx: '/file/path/to/XXX.p12',
173+
passphrase: '', // optional password to your p12/PFX
174+
bundleId: '',
175+
production: false
165176
}
166177
}
167178
});

0 commit comments

Comments
 (0)