### Install Parse Server Push Adapter Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Installs the Parse Server Push Adapter using npm. Replace `` with the desired version number. ```shell npm install --save @parse/push-adapter@ ``` -------------------------------- ### Google Cloud Service Account Key Configuration Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Provides an example of how to configure the Parse Server Push Adapter using a Google Cloud service account key object directly, instead of a file path. This is useful for managing credentials programmatically. ```javascript android: { firebaseServiceAccount: { projectId: '', clientEmail: 'example@.iam.gserviceaccount.com', privateKey: '-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n' } } ``` -------------------------------- ### Expo Push Options Configuration Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Example configuration for sending push notifications using Expo, requiring an `accessToken`. ```javascript expo: { accessToken: '' } ``` -------------------------------- ### Parse Server Bundled Push Adapter Configuration Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Illustrates how to configure push options when using the version of the push adapter bundled with Parse Server. Options are nested directly under the `push` key. ```javascript const parseServerOptions = { push: { ios: { // Apple push options } // Other push options } // Other Parse Server options }; ``` -------------------------------- ### Enable Verbose Logging Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Shows how to enable verbose logging for the Parse Server Push Adapter by setting environment variables. ```bash VERBOSE=1 ``` ```bash VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1 ``` -------------------------------- ### Configure Parse Server with Push Adapter Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Demonstrates how to configure Parse Server to use the ParsePushAdapter. This involves importing the adapter and providing platform-specific options for push notifications. ```javascript import { ParsePushAdapter } from '@parse/push-adapter'; // For CommonJS replace the import statemtent above with the following line: // const ParsePushAdapter = require('@parse/push-adapter').default; const parseServerOptions = { push: { adapter: new ParsePushAdapter({ ios: { // Apple push options }, android: { // Android push options }, web: { // Web push options }, expo: { // Expo push options } }) } // Other Parse Server options }; ``` -------------------------------- ### FCM HTTP v1 API Migration Configuration Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Demonstrates the recommended configuration for sending push notifications using the FCM HTTP v1 API, which requires replacing `apiKey` with `firebaseServiceAccount`. ```javascript android: { firebaseServiceAccount: __dirname + '/firebase.json', fcmEnableLegacyHttpTransport: true } ``` -------------------------------- ### FCM Legacy API Configuration (Deprecated) Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Shows the deprecated configuration for sending push notifications via the FCM legacy API using an `apiKey`. This method is no longer recommended and will be decommissioned. ```javascript android: { // Deliver push notifications via FCM legacy API (deprecated) apiKey: '' } ``` -------------------------------- ### Enable Legacy HTTP/1.1 Transport Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Configures the push adapter to use the older HTTP/1.1 transport for FCM, instead of the default HTTP/2, by setting `fcmEnableLegacyHttpTransport` to `true`. ```javascript android: { firebaseServiceAccount: __dirname + '/firebase.json', fcmEnableLegacyHttpTransport: true } ``` -------------------------------- ### Android Push Options (FCM) Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Configuration options for sending push notifications to Android devices via Firebase Cloud Messaging (FCM). Requires a service account key file downloaded from the Firebase Console. ```javascript android: { firebaseServiceAccount: __dirname + '/firebase.json' } ``` -------------------------------- ### Apple Push Options (APNS and FCM) Source: https://github.com/parse-community/parse-server-push-adapter/blob/master/README.md Configuration options for sending push notifications to Apple devices (iOS, macOS, tvOS, watchOS) using either APNS or FCM. Requires private keys and specific IDs from Apple Developer Center or Firebase Console. ```javascript ios: { // Deliver push notifications to iOS devices via APNS token: { key: __dirname + '/apns.p8', keyId: '', teamId: '' }, topic: '', production: true }, osx: { // Deliver push notifications to macOS devices via FCM firebaseServiceAccount: __dirname + '/firebase.json' } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.