use barkust::{BarkClient, Level, Notification};
#[tokio::main]
async fn main() -> Result<(), barkust::Error> {
let device_key = std::env::var("BARK_KEY").expect("BARK_KEY environment variable not set");
let client = BarkClient::new(Some(device_key))?;
let response = client
.send_simple("Hello from barkust", "This is a simple notification")
.await?;
println!("Simple push response: {response:?}");
let notification = Notification::builder()
.title("Custom notification")
.subtitle("With subtitle")
.body("Built with the builder API")
.image("https://day.app/assets/images/avatar.jpg")
.sound("minuet")
.group("demo")
.level(Level::Active)
.archive(true)
.build();
let response = client.send(¬ification).await?;
println!("Custom push response: {response:?}");
let batch = Notification::builder()
.title("Batch push")
.body("Sent to multiple devices")
.build();
let keys = vec!["key1".into(), "key2".into()];
let response = client.send_batch(&batch, keys).await?;
println!("Batch push response: {response:?}");
Ok(())
}