package io.corbel.notifications.service;

import io.corbel.notifications.model.Domain;
import io.corbel.notifications.model.NotificationTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import us.raudi.pushraven.Pushraven;
import java.util.Arrays;

/**
 * Created by Alberto J. Rubio
 */
public class AndroidPushNotificationsService implements NotificationsService {

    private static final Logger LOG = LoggerFactory.getLogger(AndroidPushNotificationsService.class);

    @Override
    public void send(Domain domain, NotificationTemplate notificationTemplate, String... recipients) {
        Pushraven.setKey(notificationTemplate.getSender());
        Pushraven.notification.title(notificationTemplate.getTitle()).text(notificationTemplate.getText());
        Pushraven.notification.addAllMulticasts(Arrays.asList(recipients));
        try {
            Pushraven.push();
            LOG.info("Android FCM push notification sent to: " + Arrays.toString(recipients));
        } catch (Exception e) {
            LOG.error("Sending android FCM push notification error: {}", e.getMessage(), e);
        } finally {
            Pushraven.notification.clear();
        }
    }

    @Override
    public void send(Domain domain, NotificationTemplate notificationTemplate, String replyTo, String... recipient) {
        send(domain, notificationTemplate, recipient);
    }
}

@@ -196,16 +196,55 @@
 actory;%0A
+import us.raudi.pushraven.FcmResponse;%0A
 import u
@@ -898,32 +898,55 @@
 ry %7B%0A           
+ FcmResponse response =
  Pushraven.push(
@@ -974,28 +974,24 @@
 fo(%22Android 
-FCM 
 push notific

Change LOG message