Search code examples
iosobjective-cquickblox

QBChatDelegate -chatDidReceiveMessage: getting called but dialogID is NULL


I'm utilising QB for awhile now and everything was working perfectly. Something came up today and I'm not being able to receive QBChatMessages with a proper dialogID anymore. I send the message with:

[self.dialog sendMessage:message completionBlock:^(NSError * _Nullable error) {
    if (error != nil) {
         NSLog(@"error! %@", error);

    } else {
         NSLog(@"success!");
         /*locally adding message to tableview*/
    }
}

And the callback always results a success, the other end receives the message through:

- (void)chatDidReceiveMessage:(QBChatMessage *)message
{
    NSLog(@"chatDidReceiveMessage %@", message.dialogID);
}

But the dialogID I'm getting is (null), which doesn't make any sense. The variable self.dialog.ID is not null upon sending the message, the message gets to its destination with all the text I sent, but the dialogID is (null). I verified in the Chat admin panel inside my account and the dialog does not show the new messages. I'm using v2.6.0.1 btw.


Solution

  • Okay, I found my problem. Seems when I changed some sending messages methods I commented out the important part of

    message.customParameters[@"save_to_history"] = @"1";
    

    Never forget to set save_to_history custom parameter or your message will get to its recipient without a dialogID...