@Override public void onMessageReceived(String from,Bundle data){
  JSONObject jsonObject=new JSONObject();
  final Set<String> keys=data.keySet();
  for (  String key : keys) {
    try {
      jsonObject.put(key,data.getString(key));
    }
 catch (    JSONException e) {
      e.printStackTrace();
    }
  }
  Log.d(TAG,"Sending JSON:" + jsonObject.toString());
  sendNotification(jsonObject);
}

@ Override public void onMessageReceived ( String from , Bundle data ) { JSONObject jsonObject = new JSONObject ( ) ; final Set < String > keys = data . keySet ( ) ; for ( String key : keys ) { try { jsonObject . put ( key , data . getString ( key ) ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } } Log . d ( TAG , "Sending JSON:" + jsonObject . toString ( ) ) ; sendNotification ( jsonObject ) ; }
called when message is received .
