quickblox / qmchatviewcontroller-ios Goto Github PK
View Code? Open in Web Editor NEWAn elegant ready to go chat view controller for iOS applications
License: BSD 3-Clause "New" or "Revised" License
An elegant ready to go chat view controller for iOS applications
License: BSD 3-Clause "New" or "Revised" License
Currently, messages displayed from bottom to top. How to display them from top to bottom?
ld: warning: directory not found for option '-F/Users/slk039/Desktop/QuickBlox_VideoCalling_Timer/Quickblox_Videocall_Swift/Pods/../../Framework'
ld: warning: directory not found for option '-F/Users/slk039/Desktop/QuickBlox_VideoCalling_Timer/Quickblox_Videocall_Swift/Pods/../External'
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_QBChat", referenced from:
objc-class-ref in QMChatService+Bolts.o
objc-class-ref in QMChatService.o
objc-class-ref in QMContactListService+Bolts.o
objc-class-ref in QMContactListService.o
objc-class-ref in QMUsersService.o
"OBJC_CLASS$_QBChatAttachment", referenced from:
objc-class-ref in CDAttachment.o
objc-class-ref in QMChatAttachmentService.o
"OBJC_CLASS$_QBChatDialog", referenced from:
objc-class-ref in CDDialog.o
objc-class-ref in QBChatMessage+QMCustomParameters.o
objc-class-ref in QMChatService.o
"OBJC_CLASS$QBChatMessage", referenced from:
objc-class-ref in CDMessage.o
l_OBJC$CATEGORY_QBChatMessage$QMCustomParameters in QBChatMessage+QMCustomParameters.o
l_OBJC$CATEGORY_QBChatMessage$_TextEncoding in QBChatMessage+TextEncoding.o
objc-class-ref in QMChatService.o
"OBJC_CLASS$_QBContactListItem", referenced from:
objc-class-ref in CDContactListItem.o
"OBJC_CLASS$_QBGeneralResponsePage", referenced from:
objc-class-ref in QMUsersService.o
"OBJC_CLASS$_QBMulticastDelegate", referenced from:
objc-class-ref in QMAuthService.o
objc-class-ref in QMChatService.o
objc-class-ref in QMContactListService.o
objc-class-ref in QMUsersService.o
"OBJC_CLASS$_QBRequest", referenced from:
objc-class-ref in QMAuthService.o
objc-class-ref in QMChatAttachmentService.o
objc-class-ref in QMChatService+Bolts.o
objc-class-ref in QMChatService.o
objc-class-ref in QMUsersService.o
"OBJC_CLASS$_QBResponsePage", referenced from:
objc-class-ref in QMChatService+Bolts.o
objc-class-ref in QMChatService.o
"OBJC_CLASS$_QBSession", referenced from:
objc-class-ref in QMAuthService.o
objc-class-ref in QMChatService.o
objc-class-ref in QMServicesManager.o
"OBJC_CLASS$_QBSettings", referenced from:
objc-class-ref in QMChatService+Bolts.o
objc-class-ref in QMChatService.o
"OBJC_CLASS$QBUUser", referenced from:
objc-class-ref in CDUser.o
l_OBJC$CATEGORY_QBUUser$QMAssociatedObject in QBUUser+CustomData.o
l_OBJC$CATEGORY_QBUUser$_CustomData in QBUUser+CustomData.o
objc-class-ref in QMChatService.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Cocoapod version still in 0.3.2. Please update!
Hi,
How to show full name instead of senderId for each message?
Thanks
Hiren
//here is problem
/*
Exception is
*** Assertion failure in -[QMChatCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /SourceCache/UIKit_Sim/UIKit-3347.44.2/UICollectionView.m:4056
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (2) must be equal to the number of sections contained in the collection view before the update (1), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).'
*/
I just ran pod install and the project (workspace) looks like that (see screenshot). I can not run it or even see source files (only in .xproject)
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
Did this work before?
Expected behavior
Actual behavior
Logs
Attach full logs that will describe your problem (please, use github gist)
Steps to reproduce the behavior
Any others comments?
Is there any possibilities to use the QMChatSectionManager in UIViewController and how delegate methods are used in that ViewController without using the QMChatViewController. The it is implemented in UitableView and with custom cell design.
Hi,
In the chat cells the width of the container is changed according to the text. How to maintain the constant width of the container when the text is small or large.
Please give suggestions.
I'm using version 0.3.3.
I send some messages and it crash.
Here is the detail
2016-01-15 11:26:30.810 Sembang DEV[537:149053] *** Assertion failure in -[QMChatCollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.30.14/UICollectionView.m:4308
2016-01-15 11:26:35.976 Sembang DEV[537:149053] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the collection view after the update (8) must be equal to the number of sections contained in the collection view before the update (4), plus or minus the number of sections inserted or deleted (0 inserted, 0 deleted).'
I want to store my previous chats in DB then show from there in ChatviewController.
In Which method i will get the all the messages with respect to dialog id.
I debug the Sample chat and found QBChatDatasource have all the chats but didn't confident.
Please tell me where i will get the all the message. So that i will store it for future if internet not available, show old messages from the chat.
Kindly help me.
i am unable to run QMChatviewcontroller demo. get some lib error.. No issue.I created new project ,added QMChatviewcontroller through pods. Used same code from file 'DemoChatViewController' given in QMChatviewcontroller. I have just kept 2 messgaes. Plesae see the screenshot how it is looking. Look at first message. It is coming automatically. Today header must not be included in a message. Also, why the collectionview is scrolled to bottom? I tried setting automaticallyScrollsToMostRecentMessage to NO. still there is no effect?
I installed QMChatviewcontroller using command yesterday =>
pod 'QMChatViewController'
Please check.
Analyzing dependencies
[!] The dependency QuickBlox (= 2.5)
is not used in any concrete target.
The dependency QMCVDevelopment (from
../)
is not used in any concrete target.
Add targets to pod file like this
target 'QMChatViewControllerExample' do
pod 'QuickBlox', '2.5'
pod 'QMCVDevelopment', :path => '../'
end
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
I'm using this with swift 2.3 xcode 8 - I'm using the latest version of Quickblox and QMChatViewController
Did this work before?
No
Expected behavior
Can't load QMChatViewController
Actual behavior
I get a crash everytime when I try to load the nib.
'NSInvalidArgumentException', reason: 'NSLayoutConstraint for <QMInputToolbar: 0x7f970a6cb750; baseClass = UIToolbar; frame = (0 524; 320 44); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x600000023120>>: A multiplier of 0 or a nil second item together with a location for the first attribute creates an illegal constraint of a location equal to a constant. Location attributes must be specified in pairs.'
Logs
Attach full logs that will describe your problem (please, use github gist)
https://gist.github.com/anonymous/5232001f339ff0d2cb5edddd303d993e
Steps to reproduce the behavior
running on swift
Any others comments?
no
It seems like it should use QMImageView's imageViewDidTap but instead it uses
(void)handleTapGesture:(UITapGestureRecognizer *)tap {
CGPoint touchPt = [tap locationInView:self];
if (CGRectContainsPoint(self.avatarContainerView.frame, touchPt)) {
[self.delegate chatCellDidTapAvatar:self];
}
I added menu item to UIMenuController
as below:
- (void)viewDidLoad {
[super viewDidLoad];
......
[QMChatCell registerMenuAction:@selector(resendMessage:)];
UIMenuItem* item = [[UIMenuItem alloc] initWithTitle:@"Resend" action:@selector(resendMessage:)];
[UIMenuController sharedMenuController].menuItems = @[item];
......
}
- (BOOL)collectionView:(UICollectionView*)collectionView shouldShowMenuForItemAtIndexPath:(NSIndexPath*)indexPath {
QBChatMessage* item = [self.chatSectionManager messageForIndexPath:indexPath];
if (item.contentType == MessageContentTypeText) {
return [super collectionView:collectionView shouldShowMenuForItemAtIndexPath:indexPath];
}
return NO;
}
- (BOOL)collectionView:(UICollectionView*)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender {
QBChatMessage* item = [self.chatSectionManager messageForIndexPath:indexPath];
if (item.contentType == MessageContentTypeText) {
return action == @selector(copy:) || action == @selector(resendMessage:);
}
return NO;
}
- (void)collectionView:(UICollectionView*)collectionView performAction:(SEL)action forItemAtIndexPath:(NSIndexPath*)indexPath withSender:(id)sender {
QBChatMessage* message = [self.chatSectionManager messageForIndexPath:indexPath];
if (action == @selector(copy:)) {
[UIPasteboard generalPasteboard].string = message.messageText ? : EMPTY_STRING;
} else if (action == @selector(resendMessage:)) {
[self resendMessage:indexPath];
}
return;
}
- (void)resendMessage:(id)sender {
DLogWarn();
}
Menu showed up as I expected. But when I tap to Resend
item, there is nothing happen.
Maybe I have not putted selector to cell.
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: cut:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: copy:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: select:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: selectAll:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: delete:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: _promptForReplace:
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: _showTextStyleOptions:
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: _addShortcut:
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: _accessibilitySpeakLanguageSelection:�[;
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: _accessibilityPauseSpeaking:�
-[ChatViewController collectionView:canPerformAction:forItemAtIndexPath:withSender:] [Line 1184]
ACTION: makeTextWritingDirectionRightToLeft:�
What should I do in this case? Thanks!
Hi,
I am using the QMChatViewController in my app. I want to change the design as per below screenshot.
I am new to collection view. Before QMChatViewController, i used tableview and load the cells. like below design. Please suggest me how to display the profile pic for the sender and how to display the time label on the top. please give sugestions.
Thank you
Hi,
I am using the UItableview for loading the chat messages. The messages are loading in reverse order.when new message is sending it is displaying in top of all messages. I used the code like below.
//.h
@property (strong, nonatomic) QMChatSectionManager *sectionmanager;
//ViewDidload
sectionmanager=[QMChatSectionManager new];
[[ServicesManager instance].chatService addDelegate:self];
[ServicesManager instance].chatService.chatAttachmentService.delegate = self;
if ([[self storedMessages] count] > 0 && sectionmanager.totalMessagesCount == 0) {
// inserting all messages from memory storage
NSLog(@"THE MESSAGES ARE %@",[self storedMessages]);
[sectionmanager addMessages:[self storedMessages]];
[chattingTable reloadData];
}
[self refreshMessagesShowingProgress:NO];
/////////////
- (void)refreshAndReadMessages; {
[self refreshMessagesShowingProgress:YES];
[self readMessages:self.unreadMessages];
self.unreadMessages = nil;
[chattingTable reloadData];
}
/////////////////
- (NSArray *)storedMessages
{
return [[ServicesManager instance].chatService.messagesMemoryStorage messagesWithDialogID:self.dialog.ID];
}
//Number of sections
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return sectionmanager.chatSectionsCount;
}
//Number of Rows in section
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [sectionmanager messagesCountForSectionAtIndex:section];
}
////cell for row
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIDentifier=@"cell";
ChatDetailCell *cell=(ChatDetailCell *)[tableView dequeueReusableCellWithIdentifier:cellIDentifier];
if(cell==nil)
{
[[NSBundle mainBundle] loadNibNamed:@"ChatDetailCell" owner:self options:nil];
cell=self.chatCell;
}
NSUInteger lastSection = sectionmanager.chatSectionsCount - 1;
if (indexPath.section == lastSection && indexPath.item == [sectionmanager messagesCountForSectionAtIndex:lastSection] - 1) {
// the very first message
// load more if exists
// Getting earlier messages for chat dialog identifier.
[[[ServicesManager instance].chatService loadEarlierMessagesWithChatDialogID:self.dialog.ID] continueWithBlock:^id(BFTask *task) {
if ([task.result count] > 0) {
[sectionmanager addMessages:task.result];
}
return nil;
}];
}
// marking message as read if needed
QBChatMessage *message = [sectionmanager messageForIndexPath:indexPath];
[self sendReadStatusForMessage:message];
cell. msglbl.text=message.text;
//loading cell
return cell;
}
I want to use a custom tool bar for my chat view controller instead of existing tool bar available in sample-chat-IOS app.
And I don't want to disturb exiting QMToolbarContentView.nib and QMToolbarContentView.h and QMToolbarContentView.m files. Below Image 1 is the existing one. and Image 2 is what I want.
So which is the best to load my own tool bar nib. Is it possible or I should modify the existing one ?
And I found one method but don't know weather this will work ?
Please go through this stack over flow link to see the images and complete question.
[http://stackoverflow.com/questions/37215391/how-to-customised-or-else-use-my-own-nib-for-tool-bar-in-chatviewcontroller-usin]
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
Hi,
While sending the continuous images in the chat , flickering and jumbling is occurring. please give suggestions. how to stop the flickering and jumbling.It is occurring in the chat sample too.
Thank you
When pressing the Send button, I get the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString initWithString:attributes:: nil value'
Both on sample project and when tried to use in my own project.
When debugging, I noticed that it crashes when processing this line:
CGFloat collectionViewContentHeight = [self.collectionView.collectionViewLayout collectionViewContentSize].height;
That's inside scrollToBottomAnimated:
method.
Any help?
Sometimes, I got this crash.
Here is my log.
Logs
Attach full logs that will describe your problem (please, use github gist)
Environment details
QMChatViewController (0.4.0.1)
QMServices (0.4.5)
QuickBlox (2.9)
Did this work before?
No idea
Expected behavior
It must be calculated with an optional toolbar height parameter or something like bottomContentAdditionalInset
Actual behavior
newToolbarBottomLayoutGuideConstant = CGRectGetHeight([UIScreen mainScreen].bounds) - CGRectGetMinY(superViewFrame);
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
I Want To change Y position of QMChatviewcontroller.
How can i change collectionview y position.
Did this work before?
Expected behavior
Actual behavior
Logs
Attach full logs that will describe your problem (please, use github gist)
Steps to reproduce the behavior
Any others comments?
I am not sure where to put this but figured I'd just put it here. Feel free to close if this isn't the place for this.
I was trying to get rid of the space that was around the image in the QMChatAttachmentIncoming/Outgoing cells and finally figured out that it was a constraint down in the xib file. I removed the values so now there is no border around it.
However I had to modify the actual xib file in the project instead, so if I ever update it's going to be wiped away.
Just a suggestion to make those constraints configurable so that this isn't necessary.
In iOS 11 Apple introduced new pasteDelegate property of UITextView. It conflicts with pasteDelegate property of QMPlaceHolderTextView causing crash. I think it should be renamed.
I saw in this doc - http://cocoadocs.org/docsets/QMChatViewController/0.2.2/Classes/QMChatViewController.html - that there is a property called showTypingIndicator but it seems to be missing in the latest build. Is there another way to show a typing indicator?
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
Did this work before?
Expected behavior
Actual behavior
Logs
Attach full logs that will describe your problem (please, use github gist)
Steps to reproduce the behavior
Any others comments?
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
I am looking for replacement for below method as it's Deprecated in new version of quickblox.
Method :
I didn't find it anywhere. I would like to display "Today" and "Tomorrow" view in the chat controller.
I have tried with this QMChatViewController and it looks easy to use. However, in order to make it integrate into a real product, we need to customize the style of sending date of the message. Currently, the design looks not good.
I also download Q-municate in my iphone and it shows the date information elegantly. It has the day information as the header section in the chat view.
Can you help show me how to implement similar way in QMChatViewController?
pod 'QMCVDevelopment', :git => 'https://github.com/QuickBlox/QMChatViewController-ios.git', :branch => 'development'
pod 'QMServicesDevelopment', :git => '[email protected]:QuickBlox/q-municate-services-ios.git', :branch => 'development'
[!] Error installing QMServicesDevelopment
[!] /usr/bin/git clone [email protected]:QuickBlox/q-municate-services-ios.git /var/folders/kg/lqh4pqdd4z1dx261hqh97j340000gp/T/d20160211-3686-1159reo --single-branch --depth 1 --branch development
Cloning into '/var/folders/kg/lqh4pqdd4z1dx261hqh97j340000gp/T/d20160211-3686-1159reo'...
Permission denied (publickey).
fatal: Could not read from remote repository.
When setting image from url via setImageWithURL: then setting it from an image (via Camera or Library)
we will not be able to change the image via setImageWithURL: anymore.
I think that this is caused by the following test in setImageWithURL: method:
if ([url isEqual:self.url]) {
return;
}
In the demo swift app as well as the app that I'm writing, when you hold your finger over the cells for a second or so, they turn gray or green. I'm wondering if there is a simple way to turn this off or to change the colors. I've been digging in the code and haven't had any luck yet.
Thanks.
Hey guys, I looked trough your demo project for swift, my question is can I use QMChatViewController without writing or overriding it. So I mean that in your demo project you've added a lot of sources and for now after migration from previous version to new one it's hard to migrate for me all code. at least that we don't have any section manager before and I also has my custom object that handle for me authorization and mange quick block dialogs features.
thanks
running pod install will install 0.3.9 ... please summit the latest version to trunk. 👎
Things seem to be crashing while rotating (feels like some kind of a race condition)
2016-04-08 15:51:21.270 imhr-ios[40586:15177614] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArray0 objectAtIndex:]: index 0 beyond bounds for empty NSArray'
*** First throw call stack:
(
0 CoreFoundation 0x0000000102550d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000100d7fdeb objc_exception_throw + 48
2 CoreFoundation 0x00000001024f8885 -[__NSArray0 objectAtIndex:] + 101
3 imhr-ios 0x0000000100014e69 -[QMChatSectionManager messageForIndexPath:] + 126
4 imhr-ios 0x0000000100018956 -[QMChatViewController collectionView:itemIdAtIndexPath:] + 77
5 imhr-ios 0x0000000100010680 -[QMChatCollectionViewFlowLayout containerViewSizeForItemAtIndexPath:] + 143
6 imhr-ios 0x0000000100010ad7 -[QMChatCollectionViewFlowLayout sizeForItemAtIndexPath:] + 31
7 imhr-ios 0x00000001000188e1 -[QMChatViewController collectionView:layout:sizeForItemAtIndexPath:] + 50
8 UIKit 0x00000001052334f7 -[UICollectionViewFlowLayout _getSizingInfos] + 1891
9 UIKit 0x0000000105234c47 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 118
10 UIKit 0x000000010522e3fd -[UICollectionViewFlowLayout prepareLayout] + 273
11 UIKit 0x000000010524ec3d -[UICollectionViewData _prepareToLoadData] + 67
12 UIKit 0x000000010524f411 -[UICollectionViewData validateLayoutInRect:] + 53
13 UIKit 0x0000000105252368 -[UICollectionViewData layoutAttributesForElementsInRect:] + 161
14 UIKit 0x00000001051f6c2d -[UICollectionView _updateVisibleCellsNow:] + 531
16 UIKit 0x0000000105206eab -[UICollectionView _updateSections:updateAction:] + 119
17 UIKit 0x000000011a18c00b -[UICollectionViewAccessibility deleteSections:] + 43
18 imhr-ios 0x0000000100016add __111-[QMChatViewController chatSectionManager:didDeleteMessagesWithIDs:atIndexPaths:withSectionsIndexSet:animated:]_block_invoke + 117
19 imhr-ios 0x0000000100016953 -[QMChatViewController chatSectionManager:didDeleteMessagesWithIDs:atIndexPaths:withSectionsIndexSet:animated:] + 618
20 imhr-ios 0x0000000100013f98 __48-[QMChatSectionManager deleteMessages:animated:]_block_invoke_2 + 258
21 libdispatch.dylib 0x00000001062db3d7 _dispatch_client_callout + 8
22 libdispatch.dylib 0x00000001062c6e2f _dispatch_barrier_sync_f_slow_invoke + 65
23 libdispatch.dylib 0x00000001062db3d7 _dispatch_client_callout + 8
24 libdispatch.dylib 0x00000001062c5e5d _dispatch_main_queue_callback_4CF + 714
25 CoreFoundation 0x00000001024aa0f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
26 CoreFoundation 0x000000010246bb99 __CFRunLoopRun + 2073
27 CoreFoundation 0x000000010246b0f8 CFRunLoopRunSpecific + 488
28 GraphicsServices 0x00000001072c5ad2 GSEventRunModal + 161
29 UIKit 0x000000010497cf09 UIApplicationMain + 171
30 imhr-ios 0x000000010004a072 main + 146
31 libdyld.dylib 0x000000010630a92d start + 1
Hi,
Can you show me how to handle tap action in message with picture attachment please?
I tried collectionView:didSelectItemAtIndexPath but it never called.
Thank you.
//iOS version- 9.3, Quickblox iOS SDK version- 2.0, QMChatViewController version- Latest
// Problem :- When I use UIMenuController to navigate to any view controller and when I navigate back to ChatView and pop to dialogue view It crashes because of ChatCell is been Deallocated .
Example : - create a forward menuController Item and just navigate to any view controller and just click on back to chat view controller and then back to recent chat view controller
// in QMChatViewController.m
`- (void)viewDidLoad {
[super viewDidLoad];
[[[self class] nib] instantiateWithOwner:self options:nil];
[self configureMessagesViewController];
[self registerForNotifications:YES];
//Customize your toolbar buttons
self.inputToolbar.contentView.leftBarButtonItem = [self accessoryButtonItem];
self.inputToolbar.contentView.rightBarButtonItem = [self sendButtonItem];
[QMChatCell registerMenuAction:@selector(forward:)];
self.collectionView.transform = CGAffineTransformMake(1, 0, 0, -1, 0, 0);
}`
`- (void)didReceiveMenuWillShowNotification:(NSNotification *)notification {
if (!self.selectedIndexPathForMenu) {
return;
}
[[NSNotificationCenter defaultCenter] removeObserver:self
name:UIMenuControllerWillShowMenuNotification
object:nil];
UIMenuController *menu = [notification object];
[menu setMenuVisible:NO animated:NO];
selectedCell = (QMChatCell *)[self.collectionView cellForItemAtIndexPath:self.selectedIndexPathForMenu] ;
CGRect selectedCellMessageBubbleFrame = [selectedCell convertRect:selectedCell.containerView.frame toView:self.view];
UIMenuItem *forward = [[UIMenuItem alloc] initWithTitle:@"forward" action:@selector(forward:)];
[menu setMenuItems:[NSArray arrayWithObjects:forward,nil]];
[menu setTargetRect:selectedCellMessageBubbleFrame inView:self.view];
[menu setMenuVisible:YES animated:YES];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didReceiveMenuWillShowNotification:)
name:UIMenuControllerWillShowMenuNotification
object:nil];
}`
// In chatViewController.m
`- (BOOL)collectionView:(UICollectionView *)collectionView canPerformAction:(SEL)action forItemAtIndexPath:(NSIndexPath *)indexPath withSender:(id)sender {
return action == @selector(copy:) || action == @selector(forward:) ;
}`
`- (void)chatCell:(QMChatCell *)cell didPerformAction:(SEL)action withSender:(id)sender {
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
QBChatMessage *message = [self.chatSectionManager messageForIndexPath:indexPath];
if ([NSStringFromSelector(action) isEqualToString:@"forward:"]) {
//NSLog(@"hhhhhh");
[self performSegueWithIdentifier:@"forwardMessage" sender:nil];
}
}
`
It works perfectly I can get the action and can able to perform segue(Push segue) , but when I pop to chat view and when pop back to list of dialogues it crashes
Did this work before? -- NO
Logs :---
*** -[QMChatIncomingCell release]: message sent to deallocated instance 0x7fc8cc4f6b60
Help avoid duplicate issue reports, check existing issues
Environment details
iOS version, Quickblox iOS SDK version, QMChatViewController version
ios 10, Quickblox iOS SDK 2.9
Did this work before?
No
Expected behavior
chatDataSource.addMessages should add my messages to the chatDataSource.
Actual behavior
chatDataSource.addMessages adds my messages to the chatDataSource but also adds additional cells with Time headers added as information.
Logs
Attach full logs that will describe your problem (please, use github gist)
ID: 583d04ed5b5f42373e0041d0
senderID: 19921115
recipientID: 0
dateSent: 2016-11-25 08:00:00 +0000
text: November 25
customParameters: {
kQBDateDividerCustomParameterKey = 1;
}
attachments: (null)
delayed: 0
dialogID: (null)
read: 0
readIDs: (null)
deliveredIDs: (null)
markable: 0
createdAt: (null)
updatedAt: (null)
Steps to reproduce the behavior
Any others comments?
I just want to remove these cells from my chatview. Is there an easy way to do this?
I've tried your Q-municate app in appstore and also integrate your UI in my demo app. After that, I found some crash bugs when send/received messages.
They happen when reload collection view by method performBatchUpdate without correct dataSource.
Please review and fix soon ASAP.
As the title said, I want to remove the bubble image in chat view. How to do that, is there any variable to disable that?
Thanks for attention!
Hi, I need an alternative to QMChatSectionManager, since it's been deprecated in v0.4.
We use it in places like:
#pragma mark - QMChatCollectionViewDelegateFlowLayout
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
NSInteger count = [self.chatSectionManager messagesCountForSectionAtIndex:section];
if (count > 0) [UIView animateWithDuration:0.35f animations:^{
self.collectionView.alpha = 1.0f;
}]; return count;
}
For [self.chatDataSource messageForIndexPath:indexPath]
and some other occasions it's ok, chatDataSource works fine -- but sometimes I need messagesCountForSectionAtIndex
or chatSectionAtIndex
, but those aren't present in chatDataSource and don't seem to work anymore with chatSectionManager.
Environment details
QMChatViewController v0.4.0.1
Did this work before?
Yes, before v0.4
Hope you guys can help me. Thanks :)
Repeat some times, then it crashes.
I tried your demo and found that the view controller never call dealloc function.
You are using "self" instance in some block methods.
i am using QMChatViewController
In Chat Did received Message , i am Doing This .... i don't know actually how do i receive attachments and how can i display it using QMChatViewController;
When I add Message , It Doesn't Show up the image its Displays Only Blank Cell .
for(QBChatAttachment *attachment in message.attachments){
// download file by ID
[QBRequest downloadFileWithID:[attachment.ID integerValue] successBlock:^(QBResponse *response, NSData *fileData) {
//UIImage *image = [UIImage imageWithData:fileData];
QBChatMessage *message1 = [QBChatMessage message];
QBChatAttachment *attachment1 = QBChatAttachment.new;
attachment1.type = @"image/png";
attachment1.url=attachment.url;
[message1 setAttachments:@[attachment]];
message1.dateSent = message.dateSent;
[self.chatSectionManager addMessage:message1];
return;
} statusBlock:^(QBRequest *request, QBRequestStatus *status) {
// handle progress
} errorBlock:^(QBResponse *response) {
NSLog(@"error: %@", response.error);
}];
}
When i Directly add the Received message in ChatSection Manager using this Code
[self.chatSectionManager addMessage:message1];
Still i m Getting the Same Result ..
Hi,
any swift version for this sample available?
Thanks
Hiren
How to get item index when i tap on a cell that contain image, i want to get this image to show in a pop up. and i using did select item at index path method but this method didn't call.
I am calling insertMessagesToTheBottomAnimated
method in viewDidLoad method from subcalass of QMChatViewController and getting following error and crash
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteMutableAttributedString initWithString:attributes:: nil value'
I am using version 0.3 of QMChatViewController
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.