Skip to content

Add token-based configuration format for push #476

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

Merged
merged 1 commit into from
Oct 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions _includes/parse-server/push-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You will need to obtain some credentials from GCM and APNS in order to send push

#### APNS (iOS)

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/123862/push-notifications-tutorial) or [appcoda.com's iOS Push tutorial](https://www.appcoda.com/push-notification-ios/) to help you obtain a production Apple Push Certificate. Parse has always guided users to export a PFX (`.p12`) file from Keychain Access, and we support that format in Parse Server as well. Optionally, the module supports accepting the push certificate and key in `.pem` format. Token-based authentication instead of a certificate is not supported yet.
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/123862/push-notifications-tutorial) 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.

#### GCM (Android)

Expand Down Expand Up @@ -90,13 +90,29 @@ push: {
passphrase: '', // optional password to your p12
cert: '', // If not using the .p12 format, the path to the certificate PEM to load from disk
key: '', // If not using the .p12 format, the path to the private key PEM to load from disk
bundleId: '', // The bundle identifier associate with your app
bundleId: '', // The bundle identifier associated with your app
production: false // Specifies which APNS environment to connect to: Production (if true) or Sandbox
}
}
```

For iOS, if you need to support both the dev and prod certificates, you can provide an array of configurations like
For iOS, if you would like to use token-based authentication instead of certificates, you should use the following configuration format

```
push: {
ios: {
token: {
key: '/file/path/to/AuthKey_XXXXXXXXXX.p8',
keyId: "XXXXXXXXXX",
teamId: "YYYYYYYYYY" // The Team ID for your developer account
},
topic: 'com.domain.appname', // The bundle identifier associated with your app
production: false
}
}
```

If you would like to support both the dev and prod certificates, you can provide an array of configurations like

```js
push: {
Expand Down