1
0
mirror of https://github.com/bitwarden/server.git synced 2025-02-01 23:31:41 +01:00

migrator update

This commit is contained in:
Kyle Spearrin 2017-06-16 20:18:30 -04:00
parent 03dd6a71e4
commit 8112825556

View File

@ -62,6 +62,11 @@ namespace Bit.AnhMigrator
{ {
i++; i++;
if(string.IsNullOrWhiteSpace(device.PushToken))
{
return;
}
var installation = new Installation var installation = new Installation
{ {
InstallationId = device.Id.ToString(), InstallationId = device.Id.ToString(),
@ -70,9 +75,9 @@ namespace Bit.AnhMigrator
}; };
installation.Tags = new List<string> installation.Tags = new List<string>
{ {
$"userId:{device.UserId}" $"userId:{device.UserId}"
}; };
if(!string.IsNullOrWhiteSpace(device.Identifier)) if(!string.IsNullOrWhiteSpace(device.Identifier))
{ {
@ -91,9 +96,9 @@ namespace Bit.AnhMigrator
switch(device.Type) switch(device.Type)
{ {
case DeviceType.Android: case DeviceType.Android:
payloadTemplate = "{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}"; payloadTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}}";
messageTemplate = "{\"data\":{\"type\":\"#(type)\"}," + messageTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\"}," +
"\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}"; "\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}";
installation.Platform = NotificationPlatform.Gcm; installation.Platform = NotificationPlatform.Gcm;
break; break;