I am using templates to register for users' devices and for each device (iOS), I am registering 2 templates with their own like this.
Standard Template
var generaliOSTemplate = new InstallationTemplate
{
Body = "{\"aps\":{\"alert\":\"$(message)\"},\"type\":\"$(notificationType)\",\"url\":\"$(externalUrl)\"}",
Headers = new Dictionary<string, string>
{
{"apns-push-type", "alert" },
{"apns-priority","10" }
}
};
Silent Template
var silentiOSTemplate = new InstallationTemplate
{
Body = "{\"aps\":{ \"content-available\": 1 },\"type\":\"$(notificationType)\"}",
Headers = new Dictionary<string, string>
{
{"apns-push-type", "background" },
{"apns-priority","5" }
}
};
Installation Registration
var installationsDic = new Dictionary<string, InstallationTemplate>();
if (model.platform == NotificationPlatform.Apns)
{
installationsDic.Add("genericAppleTemplate", generaliOSTemplate);
installationsDic.Add("silentAppleTemplate", silentiOSTemplate);
}
var installation = new Installation
{
InstallationId = model.tag,
Platform = model.platform,
PushChannel = model.pushChannelDeviceId,
Templates = installationsDic,
Tags = new[] { model.tag } // Tag contain Users unique Member ID
};
await _nhClient.CreateOrUpdateInstallationAsync(installation);
Now the issue that we are facing is that even though we are sending standard push notifications to a specific member, users were not receiving Push Notifications, after debugging we found that Notification Hub is sending PN to Silent Template which is not correct.
Can someone help us as this is causing significant issues for us?
For reference, we are using Rest API to send Notifications. I have attached screenshots as well
Hi,
I am using templates to register for users' devices and for each device (iOS), I am registering 2 templates with their own like this.
Standard Template
Silent Template
Installation Registration
Now the issue that we are facing is that even though we are sending standard push notifications to a specific member, users were not receiving Push Notifications, after debugging we found that Notification Hub is sending PN to Silent Template which is not correct.
Can someone help us as this is causing significant issues for us?
For reference, we are using Rest API to send Notifications. I have attached screenshots as well