3 releases

0.1.3 Oct 19, 2020
0.1.2 Oct 19, 2020
0.1.1 Oct 19, 2020
0.1.0 Oct 18, 2020

#247 in WebSocket

MIT license

6KB
68 lines

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();

Dependencies

~3.5–8MB
~188K SLoC