Skip to content

Commit

Permalink
Get JSON from fcm register response
Browse files Browse the repository at this point in the history
  • Loading branch information
guiconti committed Jul 18, 2024
1 parent cd91aba commit 872369f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "push-receiver-v2",
"version": "2.2.1",
"version": "2.2.2",
"description":
"A module to subscribe to GCM/FCM and receive notifications within a node process. v2 is compatible with the latest FCM registration endpoints.",
"main": "src/index.js",
Expand Down
6 changes: 3 additions & 3 deletions src/fcm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async function installFCM(config) {

async function registerFCM(config) {
const keys = await createKeys();
const response = await fetch(
const responseJson = await fetch(
`${FCM_REGISTRATION}projects/${config.firebase.projectID}/registrations`,
{
method : 'POST',
Expand All @@ -71,10 +71,10 @@ async function registerFCM(config) {
},
}),
}
);
).then((response) => response.json());
return {
keys,
fcm : response,
fcm : responseJson,
};
}

Expand Down

0 comments on commit 872369f

Please sign in to comment.