Crates.io | pusher-beam-rust |
lib.rs | pusher-beam-rust |
version | 0.1.3 |
source | src |
created_at | 2020-10-18 23:26:58.260453 |
updated_at | 2020-10-19 06:29:52.047987 |
description | Pusher BEAMS support for rust. |
homepage | https://github.com/tyrchen/pusher-beam-rust |
repository | https://github.com/tyrchen/pusher-beam-rust |
max_upload_size | |
id | 302537 |
size | 5,747 |
Pusher BEAMS support. See: https://pusher.com/docs/beams.
Example:
let instance_id = env::var("PUSHER_BEAM_INSTANCE_ID").unwrap();
let secret = env::var("PUSHER_BEAM_SECRET").unwrap();
let pusher = PusherBeam::new(&instance_id, &secret);
let request = r#"
{"web":{"notification":{"title":"Hello","body":"Hello, world!"}}}
"#;
let payload = Payload {
interests: vec!["hello".to_owned(), "hi".to_owned()],
web: serde_json::from_str(request)?,
fcm: Value::Null,
apns: Value::Null,
};
pusher.publish(&payload).await.unwrap();