protected void onNewIntent()

in messaging/testapp/src/android/java/com/google/firebase/example/TestappNativeActivity.java [43:60]


  protected void onNewIntent(Intent intent) {
    // If we do not have a 'from' field this intent was not a message and should not be handled. It
    // probably means this intent was fired by tapping on the app icon.
    Bundle extras = intent.getExtras();
    String from = extras.getString(EXTRA_FROM);
    String messageId = extras.getString(EXTRA_MESSAGE_ID_KEY);
    if (messageId == null) {
      messageId = extras.getString(EXTRA_MESSAGE_ID_KEY_SERVER);
    }
    if (from != null && messageId != null) {
      Intent message = new Intent(this, MessageForwardingService.class);
      message.setAction(MessageForwardingService.ACTION_REMOTE_INTENT);
      message.putExtras(intent);
      message.setData(intent.getData());
      MessageForwardingService.enqueueWork(this, message);
    }
    setIntent(intent);
  }