0

I have an app that runs a HTML page inside a webview that connects via the socket.io library to a nodejs server running a socket.io server. When I run the app in a simulator in my PC, the app connects perfectly every time, but when I run it on my Samsung Galaxy S9 Plus it won't connect. When I open the HTML page from my phone's browser it also connects perfectly. The only thing that is different on my phone and the simulator is the Android version. The simulator is running Android Oreo, and my phone is running Android Pie.

The question is: is there any change in webview settings/permissions since Android Pie that may cause this problem?

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
WebdevE
  • 41
  • 1
  • 10
  • https://stackoverflow.com/questions/54451203/android-9-pie-not-able-to-capture-any-api-native-web-through-network-mon/54456657#54456657 – Athira Feb 20 '19 at 11:18

2 Answers2

2

In your application tag inside manifest write below line

android:usesCleartextTraffic="true"

See for reference- https://koz.io/android-m-and-the-war-on-cleartext-traffic/

AskNilesh
  • 67,701
  • 16
  • 123
  • 163
Shivam Yadav
  • 958
  • 11
  • 23
1

You can use;

android:usesCleartextTraffic="true"
Onur A.
  • 3,007
  • 3
  • 22
  • 37