code: public void listen(MFPPushNotificationListener notificationListener) {
  
      if (!onMessageReceiverRegistered) {
        appContext.registerReceiver(onMessage, new IntentFilter(
        getIntentPrefix(appContext) + GCM_MESSAGE));
        onMessageReceiverRegistered = true;
  
        this.notificationListener = notificationListener;
        setAppForeground(true);
  
        boolean gotSavedMessages;
  
        if (pushNotificationIntent != null) {
          gotSavedMessages = getMessagesFromSharedPreferences(pushNotificationIntent.getIntExtra("notificationId", 0));
          pushNotificationIntent = null;
        } else {
          gotSavedMessages = getMessagesFromSharedPreferences(0);
        }
  
        if (!isFromNotificationBar) {
          if (gotSavedMessages) {
            dispatchPending();
          }
          cancelAllNotification();
        } else {
          if (messageFromBar != null) {
            isFromNotificationBar = false;
            sendNotificationToListener(messageFromBar);
            cancelNotification(messageFromBar);
            messageFromBar = null;
          }
        }
      } else {
        logger.info("MFPPush:listen() - onMessage broadcast listener has already been registered.");
      }
    }
docs: Request MFPPush to deliver incoming push messages to listener.onReceive()
  method.
  <p/>
  This method is typically called from the onResume() method of the
  activity that is handling push notifications.
  
  @param notificationListener MFPPushNotificationListener object whose onReceive() method
  will be called upon receipt of a push message.