From 64d10632ec613a9cb822667048b5bf16b8b7987e Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Wed, 15 May 2024 17:26:30 +0200 Subject: [PATCH 1/4] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 14adf180..4c3be32f 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ const parseServerOptions = { #### Migration from FCM legacy API to FCM HTTP v1 API (June 2024) -Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decomissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`. +Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decommissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`. Example options: From f4d56a62ac3a2d8add7babadf154175d0663250c Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Wed, 15 May 2024 17:39:59 +0200 Subject: [PATCH 2/4] Update README.md --- README.md | 71 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 4c3be32f..e271f966 100644 --- a/README.md +++ b/README.md @@ -15,39 +15,18 @@ The official Push Notification adapter for Parse Server. See [Parse Server Push --- -- [Silent Notifications](#silent-notifications) +- [Installation](#installation) +- [Configure Parse Server](#configure-parse-server) + - [Apple Push Options](#apple-push-options) + - [Android Push Options](#android-push-options) + - [Migration from FCM legacy API to FCM HTTP v1 API (June 2024)](#migration-from-fcm-legacy-api-to-fcm-http-v1-api-june-2024) + - [Expo Push Options](#expo-push-options) +- [Bundled with Parse Server](#bundled-with-parse-server) - [Logging](#logging) -- [Using a Custom Version on Parse Server](#using-a-custom-version-on-parse-server) - - [Install Push Adapter](#install-push-adapter) - - [Configure Parse Server](#configure-parse-server) - - [Apple Push Options](#apple-push-options) - - [Android Push Options](#android-push-options) - - [Migration from FCM legacy API to FCM HTTP v1 API (June 2024)](#migration-from-fcm-legacy-api-to-fcm-http-v1-api-june-2024) - - [Expo Push Options](#expo-push-options) -# Silent Notifications +## Installation -If you have migrated from parse.com and you are seeing situations where silent (newsstand-like presentless) notifications are failing to deliver please ensure that your payload is setting the content-available attribute to Int(1) and not "1" This value will be explicitly checked. - -# Logging - -You can enable verbose logging with environment variables: - -``` -VERBOSE=1 - -or - -VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1 -``` - -This will produce a more verbose output for all the push sending attempts - -# Using a Custom Version on Parse Server - -## Install Push Adapter - -```bash +```shell npm install --save @parse/push-adapter@ ``` @@ -174,3 +153,35 @@ expo: { ``` For more information see the [Expo docs](https://docs.expo.dev/push-notifications/overview/). + +## Bundled with Parse Server + +Parse Server already comes bundled with a specific version of the push adapter. This installation is only necessary when customizing the push adapter version that should be used by Parse Server. When using a customized version of the push adapter, ensure that it's compatible with the version of Parse Server you are using. + +When using the bundled version, it is not necessary to initialize the push adapter in code and the push options are configured directly in the `push` key, without the nested `adapter` key: + +```js +const parseServerOptions = { + push: { + ios: { + // Apple push options + }, + // Other push options + }, + // Other Parse Server options +} +``` + +## Logging + +You can enable verbose logging to produce a more detailed output for all push sending attempts with the following environment variables: + +```js +VERBOSE=1 +``` + +or + +```js +VERBOSE_PARSE_SERVER_PUSH_ADAPTER=1 +``` From 6c8c6ca8530b7440a871f0b36ad93c156e2b9d0d Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Wed, 15 May 2024 17:54:41 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e271f966..e3d9b65d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ The official Push Notification adapter for Parse Server. See [Parse Server Push - [Configure Parse Server](#configure-parse-server) - [Apple Push Options](#apple-push-options) - [Android Push Options](#android-push-options) - - [Migration from FCM legacy API to FCM HTTP v1 API (June 2024)](#migration-from-fcm-legacy-api-to-fcm-http-v1-api-june-2024) + - [Migration to FCM HTTP v1 API (June 2024)](#migration-to-fcm-http-v1-api-june-2024) - [Expo Push Options](#expo-push-options) - [Bundled with Parse Server](#bundled-with-parse-server) - [Logging](#logging) @@ -121,7 +121,28 @@ const parseServerOptions = { } ``` -#### Migration from FCM legacy API to FCM HTTP v1 API (June 2024) +Alternatively, instead of setting `firebaseServiceAccount` to the path of the JSON file, you can provide an object representing a Google Cloud service account key: + +```js +const parseServerOptions = { + push: { + adapter: new PushAdapter({ + android: { + firebaseServiceAccount: { + projectId: '', + clientEmail: 'example@.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY----------END PRIVATE KEY-----\n' + }, + }, + }), + }, + // Other Parse Server options +} +``` + +This can be helpful if you are already managing credentials to Google Cloud APIs in other parts of your code and you want to reuse these credentials, or if you want to manage credentials on a more granular level directly via Google Cloud. + +#### Migration to FCM HTTP v1 API (June 2024) Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decommissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`. From 20b73f66b5cf1a4c87909eb1f48bd9c3b4daf3cd Mon Sep 17 00:00:00 2001 From: Manuel Trezza <5673677+mtrezza@users.noreply.github.com> Date: Wed, 15 May 2024 17:55:39 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e3d9b65d..863fb6bf 100644 --- a/README.md +++ b/README.md @@ -144,9 +144,9 @@ This can be helpful if you are already managing credentials to Google Cloud APIs #### Migration to FCM HTTP v1 API (June 2024) -Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decommissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`. +⚠️ Sending push notifications to Android devices via the FCM legacy API was deprecated on June 20 2023 and was announced to be decommissioned in June 2024. See [Google docs](https://firebase.google.com/docs/cloud-messaging/migrate-v1). To send push notifications to the newer FCM HTTP v1 API you need to update your existing push configuration for Android by replacing the key `apiKey` with `firebaseServiceAccount`. -Example options: +Example options (deprecated): ```js const PushAdapter = require('@parse/push-adapter').default;