@@ -223,6 +223,7 @@ def apns_send_message(
223
223
priority : int = None ,
224
224
collapse_id : str = None ,
225
225
mutable_content : bool = False ,
226
+ category : str = None ,
226
227
err_func : ErrFunc = None ,
227
228
):
228
229
"""
@@ -242,6 +243,10 @@ def apns_send_message(
242
243
:param mutable_content: If True, enables the "mutable-content" flag in the payload.
243
244
This allows the app's Notification Service Extension to modify
244
245
the notification before it is displayed.
246
+ :param category: The category identifier for actionable notifications.
247
+ This should match a category identifier defined in the app's
248
+ Notification Content Extension or UNNotificationCategory configuration.
249
+ It allows the app to display custom actions with the notification.
245
250
"""
246
251
results = apns_send_bulk_message (
247
252
registration_ids = [registration_id ],
@@ -258,6 +263,7 @@ def apns_send_message(
258
263
priority = priority ,
259
264
collapse_id = collapse_id ,
260
265
mutable_content = mutable_content ,
266
+ category = category ,
261
267
err_func = err_func ,
262
268
)
263
269
@@ -283,6 +289,7 @@ def apns_send_bulk_message(
283
289
priority : int = None ,
284
290
collapse_id : str = None ,
285
291
mutable_content : bool = False ,
292
+ category : str = None ,
286
293
err_func : ErrFunc = None ,
287
294
):
288
295
"""
@@ -300,6 +307,10 @@ def apns_send_bulk_message(
300
307
:param mutable_content: If True, enables the "mutable-content" flag in the payload.
301
308
This allows the app's Notification Service Extension to modify
302
309
the notification before it is displayed.
310
+ :param category: The category identifier for actionable notifications.
311
+ This should match a category identifier defined in the app's
312
+ Notification Content Extension or UNNotificationCategory configuration.
313
+ It allows the app to display custom actions with the notification.
303
314
"""
304
315
try :
305
316
topic = get_manager ().get_apns_topic (application_id )
@@ -321,6 +332,7 @@ def apns_send_bulk_message(
321
332
priority = priority ,
322
333
collapse_id = collapse_id ,
323
334
mutable_content = mutable_content ,
335
+ category = category ,
324
336
err_func = err_func ,
325
337
))
326
338
@@ -366,6 +378,7 @@ async def _send_bulk_request(
366
378
priority : int = None ,
367
379
collapse_id : str = None ,
368
380
mutable_content : bool = False ,
381
+ category : str = None ,
369
382
err_func : ErrFunc = None ,
370
383
):
371
384
client = _create_client (
@@ -375,6 +388,8 @@ async def _send_bulk_request(
375
388
aps_kwargs = {}
376
389
if mutable_content :
377
390
aps_kwargs ["mutable-content" ] = mutable_content
391
+ if category :
392
+ aps_kwargs ["category" ] = category
378
393
379
394
requests = [_create_notification_request_from_args (
380
395
registration_id ,
0 commit comments