package org.forestguardian.Helpers;

import android.util.Log;

import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;

/**
 * Created by luisalonsomurillorojas on 25/7/17.
 */

public class NotificationsMessageManager extends FirebaseMessagingService {

    private static final String TAG = NotificationsMessageManager.class.getSimpleName();

    @Override
    public void onMessageReceived(RemoteMessage remoteMessage) {
        // ...

        // TODO(developer): Handle FCM messages here.
        // Not getting messages here? See why this may be: https://goo.gl/39bRNJ
        Log.d(TAG, "From: " + remoteMessage.getFrom());

        // Check if message contains a data payload.
        if (remoteMessage.getData().size() > 0) {
            Log.d(TAG, "Message data payload: " + remoteMessage.getData());
        }

        // Check if message contains a notification payload.
        if (remoteMessage.getNotification() != null) {
            Log.d(TAG, "Message Notification Body: " + remoteMessage.getNotification().getBody());
        }

        // Also if you intend on generating your own notifications as a result of a received FCM
        // message, here is where that should be initiated. See sendNotification method below.
    }

}

@@ -30,16 +30,106 @@
 lpers;%0A%0A
+import android.app.NotificationManager;%0Aimport android.support.v4.app.NotificationCompat;%0A
 import a
@@ -262,16 +262,46 @@
 ssage;%0A%0A
+import org.forestguardian.R;%0A%0A
 /**%0A * C
@@ -1221,202 +1221,834 @@
     
+    sendNotification(remoteMessage.getNotification().getTitle(), remoteMessage.getNotification().getBody());%0A        
 %7D
-%0A
 %0A    
+%7D%0A%0A
     
-// Also if you intend on generating your own notifications as a result of a received FCM%0A        // message, here is where that should be initiated. See sendNotification method below.
+private void sendNotification(String title, String body) %7B%0A        NotificationCompat.Builder mBuilder =%0A                new NotificationCompat.Builder(this)%0A                        .setSmallIcon(R.mipmap.ic_launcher)%0A                        .setContentTitle(title)%0A                        .setContentText(body);%0A        // Sets an ID for the notification%0A        int mNotificationId = (int)System.currentTimeMillis();%0A        // Gets an instance of the NotificationManager service%0A        NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);%0A        // Builds the notification and issues it.%0A        mNotifyMgr.notify(mNotificationId, mBuilder.build());
 %0A   

Add android notifications