Is there a character limit on Azure Notification Hub push message size?

Thomas Kelly 25 Reputation points
2023-09-26T09:29:08.5433333+00:00

I'd like to know if there is any limit on the number of characters for each push sent by Azure Notifications Hub. I think I read somewhere that there is a size limit of 4kb per push, but I cannot locate the resource that mentioned that. If possible, I'd prefer to learn the character limit as this will be more relatable to my management teams.

Azure Notification Hubs
Azure Notification Hubs
An Azure service that is used to send push notifications to all major platforms from the cloud or on-premises environments.
383 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2023-09-29T09:15:59.2133333+00:00

    @Thomas Kelly Thanks for reaching here!

    Yes, you are correct. Azure Notification Hubs limits the size of each push notification to 4 KB.

    This means that the number of characters you can send in a push notification will depend on the size of each character.

    For example, if you are sending only ASCII characters, you can send up to 4,000 characters in a single push notification. However, if you are sending Unicode characters, which require more bytes to represent each character, you will be able to send fewer characters in a single push notification.

    Also as its mentioned here- https://learn.microsoft.com/en-us/azure/notification-hubs/voip-apns#considerations

    Notification Hubs limits APNS payloads to 4 KB, as documented by Apple. For VOIP notifications, Apple allows payloads up to 5 KB. Notification Hubs does not differentiate between standard and VOIP notifications; therefore, all notifications are limited to 4 KB. To send VOIP notifications, you must not exceed the 4-KB payload size limit.

    Further Suggest you to refer to this link for creating the JSON payload

    Documentation for payload size limit.

    let us know.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.