apns_async does not support passing badge as a function
After a python upgrade to 3.10+, I migrated from using the apns module to using the apns_async module. I then discovered that the apns_async module does not support passing badge as a function which was a feature in the apns module.
hi @ShwnYx, perhaps, in legacy APIs yes, however, newer APIs of APNs advocated for number as keys to modify the badge icon of the app icon.
badge Number Include this key when you want the system to modify the badge of your app icon. If this key is not included in the dictionary, the badge is not changed. To remove the badge, set the value of this key to 0.
As seen from the documentation, which is why the badge key is a number.
documentation
hi @50-Course
I see I see, just to further clarify, what I meant is in apns.py, specifically here https://github.com/jazzband/django-push-notifications/blob/16d43c2f3b7593f288132731cc98cd3061bea54d/push_notifications/apns.py#L52. I can pass in the badge as a function so it can fetch a customize the badge number for each device, since the notifications are sent i bulk. For example user1 has 3 unread notifications and user2 has 4 unread notifications prior to sending the current notification, they should each receive 4 and 5 as their badge.
the new apns_async.py no longer support that so when sending notifications in bulk I can no longer customize the badge for each device. Let me know if that makes my question clearer, thanks!