My Xamarin.Forms app is sending push notification, but for some reason it does not work consistently. E.g. when a notification is sent to an Android phone, it may come immediately, or an hour later, or not come at all. Or now I am sending a notification to two iPhones. It immediately comes to one of them (SE), and does not come to the other (iPhone 8) at all. And the notifications settings are the same. This happens when I use either LTE or WiFi. How can this be explained and even fixed?
ADDED: To send push notifications, I use Microsoft.Azure.NotificationHubs.NotificationHubClient
NotificationHubClient hub = NotificationHubClient.CreateClientFromConnectionString(NotificationDispatcherConstants.FullAccessConnectionString, NotificationDispatcherConstants.NotificationHubName);
Dictionary<string, string> templateParameters = new Dictionary<string, string>();
foreach (var tag in NotificationDispatcherConstants.SubscriptionTags)
{
templateParameters["messageParam"] = json;
try
{
await hub.SendTemplateNotificationAsync(templateParameters, tag);