pusher-beam-rust

Crates.iopusher-beam-rust
lib.rspusher-beam-rust
version0.1.3
sourcesrc
created_at2020-10-18 23:26:58.260453
updated_at2020-10-19 06:29:52.047987
descriptionPusher BEAMS support for rust.
homepagehttps://github.com/tyrchen/pusher-beam-rust
repositoryhttps://github.com/tyrchen/pusher-beam-rust
max_upload_size
id302537
size5,747
Tyr Chen (tyrchen)

documentation

https://docs.rs/pusher-beam-rust/0.1.0/pusher-beam-rust/

README

Pusher

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();
Commit count: 6

cargo fmt