package com.growthpush.bridge;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.growthpush.GrowthPush;
import com.growthpush.ReceiverService;
import com.growthpush.handler.DefaultReceiveHandler;

public class ExternalFrameworkReceiverService extends ReceiverService {

    protected ExternalFrameworkBridge bridge = null;

    public ExternalFrameworkReceiverService() {
        super();
    }

    @Override
    public void onMessageReceived(String from, Bundle data) {
        if (GrowthPush.getInstance().getReceiveHandler() != null
            && GrowthPush.getInstance().getReceiveHandler() instanceof DefaultReceiveHandler) {
            DefaultReceiveHandler receiveHandler = (DefaultReceiveHandler) GrowthPush.getInstance().getReceiveHandler();
            receiveHandler.setCallback(new DefaultReceiveHandler.Callback() {
                @Override
                public void onOpen(Context context, Intent intent) {
                    super.onOpen(context, intent);
                    if (intent != null && intent.getExtras() != null && bridge != null) {
                        bridge.callbackExternalFrameworkWithExtra(intent.getExtras());
                    }
                }
            });
        }

        super.onMessageReceived(from, data);
    }
}

@@ -131,28 +131,109 @@
 om.g
-rowthpush.GrowthPush
+oogle.firebase.messaging.FirebaseMessagingService;%0Aimport com.google.firebase.messaging.RemoteMessage
 ;%0Aim
@@ -252,31 +252,26 @@
 wthpush.
-ReceiverService
+GrowthPush
 ;%0Aimport
@@ -318,16 +318,39 @@
 ndler;%0A%0A
+import java.util.Map;%0A%0A
 public c
@@ -395,24 +395,33 @@
 extends 
-Receiver
+FirebaseMessaging
 Service 
@@ -601,35 +601,336 @@
 ved(
-String from, Bundle data) %7B
+RemoteMessage message) %7B%0A        Map%3CString, String%3E data = message.getData();%0A        Bundle bundle = new Bundle();%0A        for (Map.Entry%3CString, String%3E entry : data.entrySet()) %7B%0A            bundle.putString(entry.getKey(), entry.getValue());%0A        %7D%0A        Intent intent = new Intent();%0A        intent.putExtras(bundle);
 %0A   
@@ -1675,25 +1675,24 @@
       %7D%0A
-%0A
         
 super.on
@@ -1687,42 +1687,94 @@
     
-super.onMessa
+GrowthPush.getInstance().
 ge
+t
 Receive
-d(from, data
+Handler().onReceive(getApplicationContext(), intent
 );%0A 

change ExternalFrameworkReveiverService to FirebaseServices