In-App Purchase window causing network disconnected

I’m developing a multi player game using unreal’s dedicated server, recently I add IAP(In-App Purchase) into my game,

and I notice every time I do the IAP, the game will get disconnected from server,

the reason seems like when the IAP window pops up, will trigger APP_CMD_PAUSE in GameActivity, and this cause network disconnection.

Any idea how to solve this issue?

You could try hacking things around to get your game to keep running in background, but even that wouldn’t guarantee players from getting disconnected because the IAP flow may take them further away from the app (for example, taking the user to the screen where they need to add their purchase information, which might invoke the browser) and cause Android to terminate the game if there isn’t enough RAM. It would be better to make changes to your game so it can handle users disconnecting and reconnecting when performing IAPs.