Flutter socket.io和Node.js套接字服务器

时间:2019-11-24 05:01:19

标签: node.js sockets flutter

你好,大家好吗?你能帮我吗?我使用flutter_socket_io创建了聊天应用程序。它在android 5,6,7上运行良好,但在android 8、9、10上却无法运行。我正在使用nodejs套接字服务器。

build.gradle
compileSdkVersion 28

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.socketapp"
    minSdkVersion 16
    targetSdkVersion 29
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
//////////////////////////////////////////////////--main.dart--------------
main.dart
socketIO = SocketIOManager().createSocketIO(
    "https://192.168.110.80:3002", "/room",
    query: "userId=21031", socketStatusCallback: _socketStatus);
//////////////////////////////// console -----------------
D/FlutterSocketIoPlugin: SocketIO(32224): reconnect_error: [{"cause":{"cause":{"detailMessage":"CLEARTEXT communication to 192.168.110.80 not permitted by network security policy","stackTrace":[],"suppressedExceptions":[]},"detailMessage":"websocket error","stackTrace":[],"suppressedExceptions":[]},"detailMessage":"Connection error","stackTrace":[],"suppressedExceptions":[]}]

0 个答案:

没有答案