Added untested code for calculating badge counts when sending push notifications.