Skip to content

Commit

Permalink
Had to do this to get it to work (#55)
Browse files Browse the repository at this point in the history
* private key or else we get error no auth

* Otherwise -p always gives Hello world!
  • Loading branch information
phocks authored Feb 29, 2024
1 parent c7ba285 commit 010cac3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Google has
frontend to receive notifications.

Store the subscription info to `examples/test.json` and send a notification with
`cargo run --example simple_send -- -f examples/test.json -p "It works!"`.
`cargo run --example simple_send -- -v ./private_key.pem -f examples/test.json -p "It works!"`.

Overview
--------
Expand Down
3 changes: 2 additions & 1 deletion examples/simple_send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>

if let Some(ref payload) = push_payload {
builder.set_payload(ece_scheme, payload.as_bytes());
} else {
builder.set_payload(ece_scheme, "Hello world!".as_bytes());
}

if let Some(time) = ttl {
Expand All @@ -76,7 +78,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>
let signature = sig_builder.build().unwrap();

builder.set_vapid_signature(signature);
builder.set_payload(ContentEncoding::Aes128Gcm, "test".as_bytes());
};

let client = IsahcWebPushClient::new()?;
Expand Down

0 comments on commit 010cac3

Please sign in to comment.