rive_http/miscellaneous/
web_push.rs1use crate::prelude::*;
2use rive_models::data::PushSubscribeData;
3
4impl Client {
5 pub async fn push_subscribe(&self, data: PushSubscribeData) -> Result<()> {
9 self.client
10 .post(ep!(self, "/push/subscribe"))
11 .json(&data)
12 .auth(&self.authentication)
13 .send()
14 .await?
15 .process_error()
16 .await?;
17 Ok(())
18 }
19
20 pub async fn push_unsubscribe(&self) -> Result<()> {
22 self.client
23 .post(ep!(self, "/push/unsubscribe"))
24 .auth(&self.authentication)
25 .send()
26 .await?
27 .process_error()
28 .await?;
29 Ok(())
30 }
31}