From 314a48410362f18f766608753a93248f7fc0eba6 Mon Sep 17 00:00:00 2001 From: HashimJVZ Date: Thu, 7 Nov 2024 02:33:16 +0530 Subject: [PATCH] Add Suppport for mutable_content in aioapns --- push_notifications/apns_async.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/push_notifications/apns_async.py b/push_notifications/apns_async.py index a0710d85..01ed01cd 100644 --- a/push_notifications/apns_async.py +++ b/push_notifications/apns_async.py @@ -253,6 +253,7 @@ def apns_send_message( loc_key: str = None, priority: int = None, collapse_id: str = None, + mutable_content: int = None, err_func: ErrFunc = None, ): """ @@ -275,6 +276,9 @@ def apns_send_message( apns_service = APNsService( application_id=application_id, creds=creds, topic=topic, err_func=err_func ) + aps_kwargs = {} + if mutable_content: + aps_kwargs["mutable-content"] = mutable_content request = apns_service._create_notification_request_from_args( registration_id, @@ -287,6 +291,7 @@ def apns_send_message( loc_key=loc_key, priority=priority, collapse_id=collapse_id, + aps_kwargs=aps_kwargs ) res = apns_service.send_message(request) if not res.is_successful: @@ -313,6 +318,7 @@ def apns_send_bulk_message( loc_key: str = None, priority: int = None, collapse_id: str = None, + mutable_content: int = None, err_func: ErrFunc = None, ): """ @@ -335,6 +341,9 @@ def apns_send_bulk_message( apns_service = APNsService( application_id=application_id, creds=creds, topic=topic, err_func=err_func ) + aps_kwargs = {} + if mutable_content: + aps_kwargs["mutable-content"] = mutable_content for registration_id in registration_ids: request = apns_service._create_notification_request_from_args( registration_id, @@ -347,6 +356,7 @@ def apns_send_bulk_message( loc_key=loc_key, priority=priority, collapse_id=collapse_id, + aps_kwargs=aps_kwargs ) result = apns_service.send_message(request)