diff --git a/.env b/.env.example similarity index 62% rename from .env rename to .env.example index a92194e41..a4224f84b 100644 --- a/.env +++ b/.env.example @@ -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" diff --git a/.gitignore b/.gitignore index 7e9e52aaf..e5ca28a4d 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/README.md b/README.md index 5918e7c65..ff7e8150b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/examples/simple_sender.rs b/examples/simple_sender.rs index c047f2f63..6a634b801 100644 --- a/examples/simple_sender.rs +++ b/examples/simple_sender.rs @@ -12,15 +12,12 @@ async fn main() -> Result<(), Box> { 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(); }