diff --git a/services/tunnelbroker/rust-notifications/src/apns.rs b/services/tunnelbroker/rust-notifications/src/apns.rs --- a/services/tunnelbroker/rust-notifications/src/apns.rs +++ b/services/tunnelbroker/rust-notifications/src/apns.rs @@ -9,6 +9,7 @@ certificate_path: &str, certificate_password: &str, device_token: &str, + topic: Option<&str>, message: &str, sandbox: bool, ) -> Result<()> { @@ -21,6 +22,7 @@ let client = Client::certificate(&mut certificate, certificate_password, endpoint)?; let options = NotificationOptions { + apns_topic: topic, ..Default::default() }; let builder = PlainNotificationBuilder::new(message); diff --git a/services/tunnelbroker/rust-notifications/src/lib.rs b/services/tunnelbroker/rust-notifications/src/lib.rs --- a/services/tunnelbroker/rust-notifications/src/lib.rs +++ b/services/tunnelbroker/rust-notifications/src/lib.rs @@ -12,6 +12,7 @@ certificate_path: &str, certificate_password: &str, device_token: &str, + topic: &str, message: &str, sandbox: bool, ) -> Result<()>; @@ -35,6 +36,7 @@ certificate_path: &str, certificate_password: &str, device_token: &str, + topic: &str, message: &str, sandbox: bool, ) -> Result<()> { @@ -42,6 +44,7 @@ certificate_path, certificate_password, device_token, + if topic.is_empty() { None } else { Some(topic) }, message, sandbox, ))