//! # Push notifications helper //! //! @author Pierre Hubert use crate::data::user_token::{UserAccessToken, PushNotificationToken}; use crate::data::error::Res; use crate::helpers::independent_push_notifications_service_helper; /// Un-register for previous push notifications service pub fn un_register_from_previous_service(client: &UserAccessToken) -> Res { // This method must not fail in case of error if let PushNotificationToken::INDEPENDENT(old_token) = &client.push_notifications_token { if let Err(e) = independent_push_notifications_service_helper::remove_token(old_token) { eprintln!("Failed to un-register from independent push notifications service! {}", e); } } Ok(()) }