I am using pusher_client 2.0.0 to connect to Laravel Websockets which is hosted on my VPS and replaces paid Pusher. When the application is run on the Android Emulator, or on a physical device in debug mode, everything works fine. The data is coming in, there is a connection to the Websockets server. But if you compile the application (flutter build apk) and run this apk on a physical device, then the connection with Laravel Websockets does not work. However, normal HTTP requests are sent without problems.
The AndroidManifest
contains the line <uses-permission android:name="android.permission.INTERNET" />
. I also tried to add android:usesCleartextTraffic="true"
to the application
tag in AndroidManifest
. And tried to allow Insecure HTTP connections through the android/app/src/main/res/xml/network_security_config.xml
file.
Contents of AndroidManifest.xml
Contents of network_security_config.xml