package com.selfservit.util;

import com.google.firebase.iid.FirebaseInstanceId;

import org.json.JSONArray;
import org.json.JSONException;
import org.apache.cordova. * ;
import org.json.JSONObject;

public class mPushNotification extends CordovaPlugin {
	 @ Override
	public boolean execute(final String action, JSONArray args, final CallbackContext callbackContext)throws JSONException {
		FirebaseApp.initializeApp(this);
		if (action.equals("GetToken")) {
			String token = FirebaseInstanceId.getInstance().getToken();
			if(!token.equals(null)) {
				callbackContext.success(token);
			}else{
				callbackContext.error("Token not yet generated");
			}
		}
		return true;
	}
}

@@ -73,16 +73,56 @@
 tanceId;
+%0Aimport com.google.firebase.FirebaseApp;
 %0A%0Aimport
@@ -455,12 +455,29 @@
 App(
-this
+cordova.getActivity()
 );%0A%09

Update mPushNotification.java