As a architectural tip, when creating a multiplayer game, what you’d probably want to do is have a separate server which manages the game state. You could technically have one of the client apps host this server, or it could live on its own hardware, in the cloud, etc.
Then both apps connect to the server and communicate with it, rather than directly communicating with each other. They send changes to the server, the server processes the changes, then it sends the updated game state to each client.
The alternative is basically having each client update its own copy of the game state, and you need to try and synchronize changes between the two clients. This can be tricky to get right, especially in the situation where the network is flaky and communication gets dropped, or when trying to scale up to more players. With a true client-server model, each client can request the latest game state if it ever has an issue with the network, and more players just means more apps connecting to the server.