How to launch the game events listener onGameLaunch

Hello,

When I launch a game while my application is open, it does NOT change windows or anything like that, I have a window called ‘Logged_In’ that fire when the user logs in, I want this window to be listening for the game launch event and onGameStart, I want to listen for the game events.

I have the following code to try do this:

private constructor() {

    super(windowNames.loggedIn);

    this._hearthstoneGameListener = new OWGameListener({

      onGameStarted: this.runEventListener

    });

    this._hearthstoneGameEventsListener = new OWGamesEvents({

      onInfoUpdates: this.onInfoUpdates.bind(this),

      onNewEvents: this.onNewEvents.bind(this)

    },

      interestingFeatures);

    

  }

  private runEventListener() {

   this._hearthstoneGameEventsListener.start();

  }

  public async run() {

    this._hearthstoneGameListener.start();

  }

The issue is that when I run the game, the onGameStart event fires and comes back with an error saying that the gameEventListener cannot be ran under the onGameStart.

Is there a better way to do this or a fix for this issue?

TL/DR: I want to launch my GameEventsListener on game start.

Hi.
What is your high-level goal here? To launch your OW app when a specific game is launched?
For that, you have the launch_events manifest property.