Skip to content

Commit

Permalink
FIX: FCM pushes fixed due to deprecation of legacy api
Browse files Browse the repository at this point in the history
  • Loading branch information
Overtorment committed Dec 15, 2024
1 parent b45deac commit 8cd02ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ Set them as env variables or put them into `.env` file in project root dir.
- `BITCOIN_RPC` for example `http://username:password@host:8332`
- `APNS_TOPIC` for example `io.bluewallet.bluewallet`
- `GOOGLE_KEY_FILE` - json file with Google key for FCM, in hex
- `GOOGLE_PROJECT_ID` - acquired with the key file


### Getting certificates

- outdated https://dev.to/jakubkoci/react-native-push-notifications-313i
- https://stackoverflow.com/questions/44631803/ios-swift-how-to-create-p8-file/67533665#67533665
- get P8 hex `xxd -p file.p8 | tr -d '\n'` (google key file as well)
- https://firebase.google.com/docs/cloud-messaging/migrate-v1

### License

Expand Down
2 changes: 1 addition & 1 deletion src/class/GroundControlToMajorTom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export class GroundControlToMajorTom {
}

// @ts-ignore
const rawResponse = await fetch("https://fcm.googleapis.com/v1/projects/bluewallet-d7cd5/messages:send", {
const rawResponse = await fetch(`https://fcm.googleapis.com/v1/projects/${process.env.GOOGLE_PROJECT_ID}/messages:send`, {
method: "POST",
headers: {
Authorization: `Bearer ${bearer}`,
Expand Down

0 comments on commit 8cd02ff

Please sign in to comment.