Skip to content

Commit 151a072

Browse files
authored
feat: Add how to configure watchOS push notifications
1 parent bbf1ec2 commit 151a072

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

_includes/parse-server/push-notifications.md

Lines changed: 13 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, 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:
@@ -44,7 +44,7 @@ You will need to obtain some credentials from FCM and APNS in order to send push
4444

4545
#### APNS (iOS)
4646

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.
47+
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.
4848

4949
#### FCM (Android)
5050

@@ -127,13 +127,16 @@ push: {
127127
tvos: [
128128
// ...
129129
],
130+
watchos: [
131+
// ...
132+
],
130133
osx: [
131134
// ...
132135
]
133136
}
134137
```
135138

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.
139+
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.
137140

138141
```js
139142
var server = new ParseServer({
@@ -162,6 +165,12 @@ var server = new ParseServer({
162165
passphrase: '', // optional password to your p12/PFX
163166
bundleId: '',
164167
production: false
168+
},
169+
watchos: {
170+
pfx: '/file/path/to/XXX.p12',
171+
passphrase: '', // optional password to your p12/PFX
172+
bundleId: '',
173+
production: false
165174
}
166175
}
167176
});

0 commit comments

Comments
 (0)