From 8112825556ba835fbce8037e7814ea2a07976ef4 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 16 Jun 2017 20:18:30 -0400 Subject: [PATCH] migrator update --- util/AnhMigrator/Program.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/util/AnhMigrator/Program.cs b/util/AnhMigrator/Program.cs index a854a7dc14..a07acfd11d 100644 --- a/util/AnhMigrator/Program.cs +++ b/util/AnhMigrator/Program.cs @@ -62,6 +62,11 @@ namespace Bit.AnhMigrator { i++; + if(string.IsNullOrWhiteSpace(device.PushToken)) + { + return; + } + var installation = new Installation { InstallationId = device.Id.ToString(), @@ -70,9 +75,9 @@ namespace Bit.AnhMigrator }; installation.Tags = new List - { - $"userId:{device.UserId}" - }; + { + $"userId:{device.UserId}" + }; if(!string.IsNullOrWhiteSpace(device.Identifier)) { @@ -91,9 +96,9 @@ namespace Bit.AnhMigrator 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;