Open amrit42087 opened 8 years ago
Is the socket a property or a local variable? If it's a local variable you're doing it wrong, since it'll be released once it goes out of scope.
Its a Property.
@property (strong,nonatomic) SocketIOClient* socket;
It looks like you're expecting to get the same event that you're sending? Is that the correct API? If it is you should make sure your server is configured properly
The server is configured properly as everything works fine on Android. The same URL works fine.
Do you see your event getting to the engine in your logs?
Yes message is received at the backend.
I meant from the client's engine log. It would look something like LOG SocketEngine: Got message: 451-["multipleItems",[1,2],{"test":"bob"},25,"polo",{"_placeholder":true,"num":0}]
Hi I am using Objective-C for my project. The socket is getting connected. I am initialising the Socket Object like this.
socket = [[SocketIOClient alloc] initWithSocketURL:url options:@{@"log": @YES, @"forcePolling": @YES}];
I am calling the emit method method after getting connected. But the Socket On method is not getting called.This is the code that I am using.
[socket on:@"xxxx:chat" callback:^(NSArray data, SocketAckEmitter ack) { NSLog(@"Data--%@",data); }];
[socket on:@"connect" callback:^(NSArray data, SocketAckEmitter ack) { NSLog(@"socket connected--%ld",(long)[socket status]);
[socket emit:@"xxxx:chat" withItems:@[@{@"sender_id":@"57307868bbe22c8363cc059e",@"to_id":@"573079babbe22c8363cc059f",@"msg":@" Message"}]]; }];