diff --git a/src/Core/Constants.cs b/src/Core/Constants.cs index 37eee0c70a..55751c4dfd 100644 --- a/src/Core/Constants.cs +++ b/src/Core/Constants.cs @@ -134,7 +134,6 @@ public static class FeatureFlagKeys public const string AC1795_UpdatedSubscriptionStatusSection = "AC-1795_updated-subscription-status-section"; public const string UnassignedItemsBanner = "unassigned-items-banner"; public const string EnableDeleteProvider = "AC-1218-delete-provider"; - public const string AnhFcmv1Migration = "anh-fcmv1-migration"; public static List GetAllKeys() { diff --git a/src/Core/Services/Implementations/NotificationHubPushRegistrationService.cs b/src/Core/Services/Implementations/NotificationHubPushRegistrationService.cs index b3f46bd139..9a31a2a879 100644 --- a/src/Core/Services/Implementations/NotificationHubPushRegistrationService.cs +++ b/src/Core/Services/Implementations/NotificationHubPushRegistrationService.cs @@ -11,19 +11,16 @@ public class NotificationHubPushRegistrationService : IPushRegistrationService { private readonly IInstallationDeviceRepository _installationDeviceRepository; private readonly GlobalSettings _globalSettings; - private readonly IFeatureService _featureService; private readonly ILogger _logger; private Dictionary _clients = []; public NotificationHubPushRegistrationService( IInstallationDeviceRepository installationDeviceRepository, GlobalSettings globalSettings, - IFeatureService featureService, ILogger logger) { _installationDeviceRepository = installationDeviceRepository; _globalSettings = globalSettings; - _featureService = featureService; _logger = logger; // Is this dirty to do in the ctor? @@ -75,20 +72,11 @@ public class NotificationHubPushRegistrationService : IPushRegistrationService switch (type) { case DeviceType.Android: - if (_featureService.IsEnabled(FeatureFlagKeys.AnhFcmv1Migration)) - { - payloadTemplate = "{\"message\":{\"data\":{\"type\":\"$(type)\",\"payload\":\"$(payload)\"}}}"; - messageTemplate = "{\"message\":{\"data\":{\"type\":\"$(type)\"}," + - "\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}"; - installation.Platform = NotificationPlatform.FcmV1; - } - else - { - payloadTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}}"; - messageTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\"}," + - "\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}"; - installation.Platform = NotificationPlatform.Fcm; - } + payloadTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}}}"; + messageTemplate = "{\"data\":{\"data\":{\"type\":\"#(type)\"}," + + "\"notification\":{\"title\":\"$(title)\",\"body\":\"$(message)\"}}}"; + + installation.Platform = NotificationPlatform.Fcm; break; case DeviceType.iOS: payloadTemplate = "{\"data\":{\"type\":\"#(type)\",\"payload\":\"$(payload)\"}," + diff --git a/test/Core.Test/Services/NotificationHubPushRegistrationServiceTests.cs b/test/Core.Test/Services/NotificationHubPushRegistrationServiceTests.cs index b42ef1cba5..0b9c64121b 100644 --- a/test/Core.Test/Services/NotificationHubPushRegistrationServiceTests.cs +++ b/test/Core.Test/Services/NotificationHubPushRegistrationServiceTests.cs @@ -12,21 +12,18 @@ public class NotificationHubPushRegistrationServiceTests private readonly NotificationHubPushRegistrationService _sut; private readonly IInstallationDeviceRepository _installationDeviceRepository; - private readonly IFeatureService _featureService; private readonly ILogger _logger; private readonly GlobalSettings _globalSettings; public NotificationHubPushRegistrationServiceTests() { _installationDeviceRepository = Substitute.For(); - _featureService = Substitute.For(); _logger = Substitute.For>(); _globalSettings = new GlobalSettings(); _sut = new NotificationHubPushRegistrationService( _installationDeviceRepository, _globalSettings, - _featureService, _logger ); }