I am facing this issue with nativescript-websockets where the pingreq times out or I get a socked closed error after 2 minutes of normal working of socket. I made the same project in react-native and it works without any issues. The socket works for a while and I get any data in that time but then stops working without any attempt to reconnect. I am using nativescript-websockets with aws appsync.
Here is the stackoverflow issue I created for this.