Search code examples
notificationsazure-notificationhub

Azure Notification Hub templates


I am currently trying to use Notification Hub templates to send notifications to apps registered with tags. Is there a way to determine the size of the payload, after the parameters are replaced in the template? From the documentation, the payload should be smaller than 4kb and I want to make sure that I don't exceed that.


Solution

  • I'm afraid there isn't a built in way to do that using the Azure Notification Hubs API. My suggestion would be to look at the base size of each of your templates and subtract its size from 4KB. This will show you how long the cumulative length of your variables can be.

    Once you've figured out the theoretical limit, you can use the "Test Send" menu in the Azure Portal to experiment with particular payloads built with your template and variables.