Skip to content

Commit 1abd85c

Browse files
committed
feat: set apns-collapse-id for Apple notifications
1 parent 1a73075 commit 1abd85c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use a2::{
2-
DefaultNotificationBuilder, Error::ResponseError, NotificationBuilder, NotificationOptions,
3-
Priority, PushType,
2+
CollapseId, DefaultNotificationBuilder, Error::ResponseError, NotificationBuilder,
3+
NotificationOptions, Priority, PushType,
44
};
55
use anyhow::{bail, Error, Result};
66
use axum::http::StatusCode;
@@ -229,6 +229,7 @@ async fn notify_apns(state: State, client: a2::Client, device_token: String) ->
229229
apns_priority: Some(Priority::High),
230230
apns_topic: state.topic(),
231231
apns_push_type: Some(PushType::Alert),
232+
apns_collapse_id: CollapseId::new("new_messages").ok(),
232233
..Default::default()
233234
},
234235
);

0 commit comments

Comments
 (0)