Open ManojMM026 opened 5 years ago
@ManojMM026 if you are looking for ack, please use as in example https://github.com/infitio/flutter_socket_io/blob/e31e07db012840af392e6b71cd0085d74b1015ec/example/lib/main.dart#L102
No, I am not looking for ack. But why does it work on android as expected? it goes into my parse function for android and not for ios?
@ManojMM026 can you try the example setup and see if it works fine?
@tiholic I added try catch and tried to debug issue. I have a error
'_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>'
but this works for Android not for ios
'_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>'
@ManojMM026 is that coming from _handleData
in socket.dart
?
I have Response parsing class something like this
class IdentifyResponse {
Data data;
int exit;
String topic;
int v;
IdentifyResponse({this.data, this.exit, this.topic, this.v});
factory IdentifyResponse.fromJson(Map<String, dynamic> json) {
return IdentifyResponse(
data: json['data'] != null ? Data.fromJson(json['data']) : null,
exit: json['exit'],
topic: json['topic'],
v: json['v'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['exit'] = this.exit;
data['topic'] = this.topic;
data['v'] = this.v;
if (this.data != null) {
data['data'] = this.data.toJson();
}
return data;
}
}
class Data {
String device_hash;
bool online;
String salt;
Data({this.device_hash, this.online, this.salt});
factory Data.fromJson(Map<String, dynamic> json) {
return Data(
device_hash: json['device_hash'],
online: json['online'],
salt: json['salt'],
);
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['device_hash'] = this.device_hash;
data['online'] = this.online;
data['salt'] = this.salt;
return data;
}
}
It breakes in ios at
IdentifyResponse identifyResponse = IdentifyResponse.fromJson(data);
Android version works well, only ios gives me this error.
I have Response parsing class something like this
class IdentifyResponse { Data data; int exit; String topic; int v; IdentifyResponse({this.data, this.exit, this.topic, this.v}); factory IdentifyResponse.fromJson(Map<String, dynamic> json) { return IdentifyResponse( data: json['data'] != null ? Data.fromJson(json['data']) : null, exit: json['exit'], topic: json['topic'], v: json['v'], ); } Map<String, dynamic> toJson() { final Map<String, dynamic> data = new Map<String, dynamic>(); data['exit'] = this.exit; data['topic'] = this.topic; data['v'] = this.v; if (this.data != null) { data['data'] = this.data.toJson(); } return data; } } class Data { String device_hash; bool online; String salt; Data({this.device_hash, this.online, this.salt}); factory Data.fromJson(Map<String, dynamic> json) { return Data( device_hash: json['device_hash'], online: json['online'], salt: json['salt'], ); } Map<String, dynamic> toJson() { final Map<String, dynamic> data = new Map<String, dynamic>(); data['device_hash'] = this.device_hash; data['online'] = this.online; data['salt'] = this.salt; return data; } }
It breakes in ios at
IdentifyResponse identifyResponse = IdentifyResponse.fromJson(data);
Android version works well, only ios gives me this error.
@tiholic
I have a demo scheduled next week @tiholic it will be great if you can fix this quickly.
@ManojMM026 drop a mail to rr.16566@gmail.com
Issue logged here is descriptive enough, if not can you please tell me what more you need so that I can draft & send an email to you?
@ManojMM026 just drop a blank email, we can connect over a meeting and fix it.
I'm getting the same error. What's the solution? Thanks in advance. @ManojMM026 @tiholic
@bilalbaz1 please share socket.io plugin version, socket.io server version, and flutter version you're using.
@tiholic
**flutter**
adhara_socket_io: ^1.0.1+1
flutter_socket_io: ^0.6.0
**nodejs**
"socket.io": "^2.0.0",
It also works flawlessly on Android. It gives an error on ios.
SocketOptions _options = SocketOptions(
_socketRepository.url,
enableLogging: true,
transports: [Transports.webSocket],
query: {"kullaniciOdaId": widget.kullaniciOdalariModel.id},
namespace: "/",
);
_manager = SocketIOManager();
_socket = await _manager.createInstance(_options);
await _socket.connect();
He's sending a message. A message is sent to the other person over the socket. But on ios device, there is a problem connecting and listening.
Debug console https://gist.github.com/42ba634a5b8e873694041306758ff709.git
Describe the bug I am connecting to proxy url of mine, after that I emmit certain event which goes through and callback comes to socket.on, Nothing is exectuted besides print statement in socket.on on ios whereas on android it works as expected.
Expected behavior Should exectute whatever there in socket.on Device details:
Relevant Logs I am not sure if below log will help you.