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 @@ -10,7 +10,7 @@ certificate_password: &str, device_token: &str, topic: Option<&str>, - message: &str, + message_text: &str, sandbox: bool, ) -> Result<()> { let mut certificate = File::open(certificate_path)?; @@ -25,8 +25,9 @@ apns_topic: topic, ..Default::default() }; - let builder = PlainNotificationBuilder::new(message); - let payload = builder.build(device_token, options); + let builder = PlainNotificationBuilder::new(message_text); + let mut payload = builder.build(device_token, options); + payload.aps.content_available = Some(1); let response = client.send(payload).await?; if response.code != 200 { return Err(anyhow!( 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 @@ -15,7 +15,7 @@ certificate_password: &str, device_token: &str, topic: &str, - message: &str, + message_text: &str, sandbox: bool, ) -> Result<()>; @@ -42,7 +42,7 @@ certificate_password: &str, device_token: &str, topic: &str, - message: &str, + message_text: &str, sandbox: bool, ) -> Result<()> { RUNTIME.block_on(apns::send_by_a2_client( @@ -50,7 +50,7 @@ certificate_password, device_token, if topic.is_empty() { None } else { Some(topic) }, - message, + message_text, sandbox, )) }