Closed siddharth3322 closed 6 years ago
Hi @siddharth3322, Could you provide full logs (not screenshot)?
Thanks!
yes I can provide you full log now but which component, should I use? If I paste directly log over here then it will create complete mess up and all data get jumbled.
@siddharth3322 use gist - https://gist.github.com
Here is the uploaded log details: https://gist.github.com/siddharth3322/c1cff8b0578dba4a8af85494450b27fb
@siddharth3322 from your log:
10112018-03-11 20:32:13.042 ExNext[1169:690879] [QBCore] Request URL:https://api.quickblox.com/chat/Message.json?date_sent%5Bgte%5D=0&limit=10&sort_desc=date_sent
2018-03-11 20:32:13.043 ExNext[1169:690879] [QBCore] Request method: GET
2018-03-11 20:32:13.043 ExNext[1169:690879] [QBCore] Request parameters:{
"date_sent[gte]" = 0;
limit = 10;
"sort_desc" = "date_sent";
}
"date_sent[gte]" = 0; - invalid field and you set nil for dialog id (required) in:
+ (QBRequest *)messagesWithDialogID:(NSString *)dialogID
extendedRequest:(NSDictionary *) extendedParameters
forPage:(QBResponsePage *)page
successBlock:(qb_response_messages_block_t)successBlock
errorBlock:(qb_response_block_t)errorBlock
now what should I require to do for solution?
@siddharth3322 my suggestion:
Thanks!
If I just update the framework file then will it work for me?
Please check documentation - HOWTO Retrieve chat history
Thanks!
At these two places, I am assigning dialogID
- (void)didPickAttachmentImage:(UIImage *)image {
if (_chatUser.my_state == connection_state_completed_by_subscribed_user) {
NSString *strHeOrShe = [_chatUser.gender isEqual: @"M"] ? @"He" : @"She";
[self showAlertWithTitle:@"Wait for a reply" withMessage:[NSString stringWithFormat:@"You can't send any more messages to %@ untill %@ replies.",_chatUser.name, strHeOrShe]];
return;
}
QBChatMessage *message = [QBChatMessage new];
message.senderID = self.senderID;
message.dialogID = self.dialog.ID;
message.dateSent = [NSDate date];
Here is another place:
if (attachment.image) {
// NSLog(@"-----> didPressSendButton - First - userInitiatedConnection - IF");
[self userInitiatedConnection];
QBChatMessage *message = [QBChatMessage new];
message.senderID = self.senderID;
message.dateSent = [NSDate date];
if (self.dialog.ID) {
message.dialogID = self.dialog.ID;
[self.chatDataSource addMessage:message];
[[QMServicesManager instance].chatService sendAttachmentMessage:message
toDialog:self.dialog
withAttachmentImage:attachment.image
completion:^(NSError *error) {
[self.attachmentCells removeObjectForKey:message.ID];
if (error != nil) {
// perform local attachment deleting
[self.chatDataSource deleteMessage:message];
[self showAlertWithTitle:@"Failed" withMessage:error.localizedDescription];
// [SVProgressHUD showErrorWithStatus:error.localizedDescription];
}
}];
}
This is last way:
- (void)chatService:(QMChatService *)chatService didUpdateChatDialogInMemoryStorage:(QBChatDialog *)chatDialog {
if (self.dialog.type != QBChatDialogTypePrivate && [self.dialog.ID isEqualToString:chatDialog.ID]) {
self.dialog = chatDialog;
self.title = self.dialog.name;
}
}
So at which place my ID going wrong for dialog?
@siddharth3322 for fix your issue you should check this method:
+ (QBRequest *)messagesWithDialogID:(NSString *)dialogID
extendedRequest:(NSDictionary *) extendedParameters
forPage:(QBResponsePage *)page
successBlock:(qb_response_messages_block_t)successBlock
errorBlock:(qb_response_block_t)errorBlock
and investigate calls tree from debugger
can you tell me exactly in which class this method exist?
Within my code I can't able to find this one...
I have not written this method any where in my code:
yes but you call this method
and you should check why dialogID == nil
For example check our chat sample - https://github.com/QuickBlox/quickblox-ios-sdk/tree/master/sample-chat. Works fine.
Okay I will do this 👍
Now help me in my another posted issue.
From Quicblox "Response codes and errors" documentation: The requested resource could not be found:
Hi @siddharth3322, any updates ?
Basically I am new to application development and first time implementing chatting system within my application so at present I was searching exactly what I require to update!!!
how to solve issue
error: Request failed: not found (404)
reasons: {
code = "
When QMChatViewController loaded at time, I was getting this kind of error log. Though if you test within devices then you don't feel any problem is running but xCode log showing this kind of error messages.
I hope above log has given you all required details. Please reply me regarding this.