Closed phoenix3k closed 2 years ago
That sounds weird, are you getting any error? Could you enable the logs, to check if everything is right?
I found out what caused this situation, starting from android 9, it is not allowed to use http protocol for network communication, must use https or modify the configuration file. It's not socketio's problem, but Google modified the rules of network access. thank you very much.
------------------ 原始邮件 ------------------ 发件人: "socketio/socket.io-client-java" @.>; 发送时间: 2021年11月16日(星期二) 晚上9:23 @.>; @.**@.>; 主题: Re: [socketio/socket.io-client-java] Whether to support Android 11? (Issue #692)
That sounds weird, are you getting any error? Could you enable the logs, to check if everything is right?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
@phoenix3k oh, yes, that's right. We should definitely add this in the documentation.
I faced this same issue, turns out you will need to set usesCleartextTraffic
on AndroidManifest.xml
so that your app can request with the http protocol: https://developer.android.com/guide/topics/manifest/application-element#usesCleartextTraffic
Added in the documentation here: https://socketio.github.io/socket.io-client-java/android.html#How_to_reach_an_HTTP_server.3F
Please reopen if needed.
socket.io-client version is 2.0.1 and socket.io-server version is 4.2.0, but Cannot connect when running on Android 11. The same code is normal to run on Android 8.