Skip to content

Commit

Permalink
Merge pull request #1 from adnanjpg/gauth-http-v1-api-fixes
Browse files Browse the repository at this point in the history
Gauth http v1 api fixes
  • Loading branch information
rj76 authored Dec 31, 2023
2 parents 11ba7fa + e61b72d commit e765990
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env → .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# follow the instructions in the [Firebase Documentation](https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually) to create a service account. after you create a service account, and download the json file. then change the value of `GOOGLE_APPLICATION_CREDENTIALS` to the path of the json file you downloaded.
# follow the instructions in the [Firebase Documentation](https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually) to create a service account. after you create a service account, and download the json file then change the value of `GOOGLE_APPLICATION_CREDENTIALS` to the path of the json file you downloaded.
GOOGLE_APPLICATION_CREDENTIALS="/path/to/your/firebase/file.json"
21 changes: 20 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
.DS_Store
# Generated by Cargo
# will have compiled files and executables
debug/
target/

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.DS_Store

.direnv
.idea/

# local env files
# do not commit any .env files to git, except for the .env.example file. https://create.t3.gg/en/usage/env-variables#using-environment-variables
.env
.env*.local
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This fork is a rewrite to use Google's HTTP v1 API.

This library expects the Google credentials JSON location to be
defined as `GOOGLE_APPLICATION_CREDENTIALS` in the `.env` file.
Please follow the instructions in the [Firebase Documentation](https://firebase.google.com/docs/cloud-messaging/auth-server#provide-credentials-manually) to create a service account.

## Examples

Expand Down
3 changes: 0 additions & 3 deletions examples/simple_sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
pretty_env_logger::init();

let mut device_token = String::new();
let mut api_key = String::new();

{
let mut ap = ArgumentParser::new();
ap.set_description("A simple FCM notification sender");
ap.refer(&mut device_token)
.add_option(&["-t", "--device_token"], Store, "Device token");
ap.refer(&mut api_key)
.add_option(&["-k", "--api_key"], Store, "API key");
ap.parse_args_or_exit();
}

Expand Down

0 comments on commit e765990

Please sign in to comment.