Skip to content

Commit

Permalink
migrator update
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed Jun 17, 2017
1 parent 03dd6a7 commit 8112825
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions util/AnhMigrator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ private static async Task RegisterAsync(string[] args)
{
i++;

if(string.IsNullOrWhiteSpace(device.PushToken))
{
return;
}

var installation = new Installation
{
InstallationId = device.Id.ToString(),
Expand All @@ -70,9 +75,9 @@ private static async Task RegisterAsync(string[] args)
};

installation.Tags = new List<string>
{
$"userId:{device.UserId}"
};
{
$"userId:{device.UserId}"
};

if(!string.IsNullOrWhiteSpace(device.Identifier))
{
Expand All @@ -91,9 +96,9 @@ private static async Task RegisterAsync(string[] args)
switch(device.Type)
{
case DeviceType.Android:
payloadTemplate = "{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}";
messageTemplate = "{\"data\":{\"type\":\"#(type)\"}," +
"\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}";
payloadTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}}";
messageTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\"}," +
"\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}";

installation.Platform = NotificationPlatform.Gcm;
break;
Expand Down

0 comments on commit 8112825

Please sign in to comment.