-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b56118
commit 8d10ced
Showing
8 changed files
with
1,093 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
storage.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Node.js Example for @aracna/fcm | ||
|
||
Please define the following variables inside a .env file. | ||
|
||
| Name | Source | Type | | ||
| --------------------------- | ---------------- | ------ | | ||
| VITE_FIREBASE_API_KEY | Firebase Console | string | | ||
| VITE_FIREBASE_APP_ID | Firebase Console | string | | ||
| VITE_FIREBASE_PROJECT_ID | Firebase Console | string | | ||
| VITE_GOOGLE_SERVICE_ACCOUNT | Firebase Console | string | | ||
| VITE_VAPID_KEY | Firebase Console | string | | ||
|
||
The `VITE_GOOGLE_SERVICE_ACCOUNT` variable must be base64 encoded. | ||
|
||
## Install Dependencies | ||
|
||
``` | ||
pnpm i | ||
``` | ||
|
||
## Register & Listen | ||
|
||
This command registers a new device to FCM if not already registered, then connects with the client and listens to any incoming messages. | ||
|
||
``` | ||
pnpm start | ||
``` | ||
|
||
## Send Test Message | ||
|
||
This command will send a test message to the client that is listening when you run `pnpm start`, you should see it appear in its logs once sent. | ||
|
||
``` | ||
pnpm send-message | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"name": "node", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"scripts": { | ||
"send-message": "vite-node src/send-message.ts", | ||
"start": "vite-node src/register-and-listen.ts" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"@aracna/core": "^1.1.81", | ||
"@aracna/fcm": "^1.0.22", | ||
"vite": "^5.2.7", | ||
"vite-node": "^1.4.0" | ||
} | ||
} |
Oops, something went wrong.