I am registering installations from my .NET backend server code with multiple templates each. For example:
var installation = new Installation
{
InstallationId = id,
PushChannel = token,
Templates = new Dictionary<string, InstallationTemplate>(),
Tags = new List<string> { "userId:123456" },
Platform = NotificationPlatform.Gcm
};
installation.Templates.Add("template1", new InstallationTemplate { Body = "{\"data\":{\"message\":\"$(message)\"}}"});
installation.Templates.Add("template2", new InstallationTemplate { Body = "{\"data\":{\"message2\":\"$(message)\"}}"});
await _client.CreateOrUpdateInstallationAsync(installation);
How do I target a specific template when sending a notification? All I see in the SDK is the following:
await _client.SendTemplateNotificationAsync(
new Dictionary<string, string>
{
{ "message", "Hello world." }
}, "userId:123456");
The SendTemplateNotificationAsync
method does not have any parameters that let me specify which template I am targeting (for example, template2
).
Which template will be used? Am I misunderstanding something here?