so created a simple application to test out sendbird services, they look best, so i have read their documentation, and at this moment. i made something.. and i got a problem there, when do i have to call the didReceiveMessage or why mine is not working?
myCode
- (IBAction)connnect:(id)sender {
[SBDOpenChannel getChannelWithUrl:@"iDict" completionHandler:^(SBDOpenChannel * _Nullable channel, SBDError * _Nullable error) {
if (error != nil) {
NSLog(@"Error 1 : %@", error.localizedDescription);
return;
}
[channel enterChannelWithCompletionHandler:^(SBDError * _Nullable error) {
if (error != nil) {
NSLog(@"Error: %@", error);
return;
}
NSLog(@"Connected to Channel : %@",channel.channelUrl);
// ...
}];
}];
}
- (IBAction)sendMessage:(id)sender {
[self.channel sendUserMessage:@"pop" data:@"Hey" completionHandler:^(SBDUserMessage * _Nullable userMessage, SBDError * _Nullable error) {
if (error != nil) {
NSLog(@"Error: %@", error);
return;
}
}];
}
- (void)channel:(SBDBaseChannel * _Nonnull)sender didReceiveMessage:(SBDBaseMessage * _Nonnull)message {
if (sender == self.channel) {
NSLog(@"From Button.Message Received From %@ message is : %@ in channel :",sender.description,message.description);
} else {
NSLog(@"Failed");
}
}
@end