public ISenderNotification GetStrategy(Platform notificationTypes) { ISenderNotification sender = null; if (notificationTypes.Value == Platform.Android.Value) { sender = _firebaseSender; } return(sender); }
public ISenderNotification GetStrategy(Platform notificationTypes) { ISenderNotification sender = _senderNotifications.FirstOrDefault(p => p.Platform == notificationTypes); if (sender == null) { throw new InvalidOperationException($"There aren't any strategy registered for platorm '{notificationTypes}'. Please use UseApns() or UseFirebase()"); } return(sender); }