Skip to content

Commit

Permalink
feat: set apns-collapse-id for Apple notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
link2xt committed Jan 28, 2025
1 parent a5cfc0f commit 22b2a4d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use a2::{
DefaultNotificationBuilder, Error::ResponseError, NotificationBuilder, NotificationOptions,
Priority, PushType,
CollapseId, DefaultNotificationBuilder, Error::ResponseError, NotificationBuilder,
NotificationOptions, Priority, PushType,
};
use anyhow::{bail, Error, Result};
use axum::http::StatusCode;
Expand Down Expand Up @@ -179,6 +179,7 @@ async fn notify_apns(state: State, client: a2::Client, device_token: String) ->
apns_priority: Some(Priority::High),
apns_topic: state.topic(),
apns_push_type: Some(PushType::Alert),
apns_collapse_id: CollapseId::new("new_messages").ok(),
..Default::default()
},
);
Expand Down

0 comments on commit 22b2a4d

Please sign in to comment.