jsqmessagesviewcontroller

How to check a file is video or image?

会有一股神秘感。 提交于 2019-12-13 06:31:45
问题 I am developing a chat app using parse. I want to play the vodeo when users click on the video message and Display expandable image when the user click on the picture message. for that I need to differentiate image and video. Kindly guide me to do that... 回答1: Surely the easiest way will be of course to look at the file extension...? 回答2: For future googlers ... on didTapMessageBubbleAtIndexPath delegate you should check for item class let message = yourMessageArray[indexPath.item] if message

JSQMessagesViewController: How to get senderId in viewDidLoad?

旧时模样 提交于 2019-12-13 02:55:35
问题 I have a function for avatars that's called in viewDidLoad (this is the function if it helps although I think the problem is not the function itself: https://pastebin.com/ksHmucTX). In viewDidLoad I call it: createAvatar(senderId: self.senderId, senderDisplayName: self.senderDisplayName, user: self.currentUser!, color: UIColor.lightGray) But since I am only passing in my information (as the current user), when using the app I only see my avatar and not the avatars of everyone else in the chat

How to import JSQMessagesViewController in swift?

孤街醉人 提交于 2019-12-12 11:39:34
问题 I am working with xcode 6.3, swift 1.2 and I install the "JSQMessagesViewController" library with cocoapods. Here is my pod file: pod 'JSQMessagesViewController' and my bridge file: #import <JSQMessagesViewController/JSQMessages.h> then I get the error: 'JSQMessagesViewController/JSQMessages.h' file not found with <angled> include; use "quotes" instead I don't know why it goes wrong. When I update the bridge file with #import "JSQMessagesViewController/JSQMessages.h" I get the error

JSQMessagesViewController in Swift with Xcode 6.3 Objective-C Selector issue

北慕城南 提交于 2019-12-12 03:35:14
问题 I am using JSQMessagesViewController in swift with Xcode 6.3 Any one know about this error? how to solve this? 回答1: Declare this as a Type function by using class func as such: class func parseClassName() -> String { return "Dan" } 回答2: I think you should assign the values of both senderId and senderDisplayName in the viewDidLoad(), instead of methods. override func viewDidLoad() { super.viewDidLoad() self.senderId = "YOUR_SENDER_ID" self.senderDisplayName = "YOUR_DISPLAY_NAME" } 来源: https:/

How to send Pictures using JSQMessagesViewController?

China☆狼群 提交于 2019-12-12 02:53:13
问题 I am using the JSQMessagesViewController in a Chat App I am making. I am able so successfully send and receive text messages but would like to add support for Images also. I have implemented the didPressAccessoryButton function which is executed when the lower bottom paper clip / attachment button is clicked. My question is - I am not sure what to do next? or how to implement the JSQPhotoMediaItem (link)??? override func didPressAccessoryButton(sender: UIButton!) { var imgToSend = UIImage

Invalid parameter not satisfying: messageSenderId != nil

本小妞迷上赌 提交于 2019-12-11 19:36:54
问题 I integrated 'XBChatModule' Library from Cocoapods into my project. When I run the code for the first time, It crashed the app by throwing following error -[XBMessage messageHash]: unrecognized selector sent to instance and it got resolved by changing XBMessage.m file as below XBMessage.m - (NSUInteger)messageHash { return self.hash; } But this produces new issue saying Assertion failure in -[ChatMessagesController collectionView:cellForItemAtIndexPath:], /Users/Neelacharya/Harshit/LIve

JSQMessagesViewController custom link

南楼画角 提交于 2019-12-11 07:33:32
问题 I'm using a swift framework and I need to be able to have a # like tag inside of a message text string. If a user sends a message containing a code prefixed with a #, for example: #t3Us9K that single "word" needs to be a link that all users can press. please tell me if this is possible and if so how to do it. 回答1: I had been working on your question and this are my results, First of all you need to modify JSQMessagesCellTextView in the library and add a method to help you to detect custom

User Specific Avatar in JSQMessagesViewController with SDWebImage

眉间皱痕 提交于 2019-12-11 02:37:17
问题 As the title would suggest im using JSQMessagesViewController. Id like each user to have their own Avatar [UIImage] ill be getting this from a URL in FirebaseDatabase and extracting it via. SDWebImage. I am able to get this inside; override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = super.collectionView(collectionView, cellForItemAt: indexPath) as! JSQMessagesCollectionViewCell let message = messages

Show LocationMediaItem in JSQMessagesViewController

两盒软妹~` 提交于 2019-12-10 10:48:15
问题 I have just tried implementing the LocationMediaItem in my Xamarin.iOS app using JSQMessagesViewController . Everything worked out fine, only problem is that the UICollectionView cell which is supposed to show the location is stuck on loading forever and the map is never actually being displayed. Here's some code how I make the locationMediaItem in C#: var locationMediaItem = new LocationMediaItem(new CLLocation(latitude, longitude)); if (ChatDB.Messages[indexPath.Row].user_id == SenderId) {

How to push a JSQMessagesViewController correctly

旧街凉风 提交于 2019-12-07 02:36:50
问题 I have a Swift project and am trying to use JSQMessagesViewController within it. I have used cocoapods to install the framework and am importing it using a swift import statement. import JSQMessagesViewController Up to this point there are no errors and everything compiles without warning. However when I try to push a new instance onto a navigation controller the app crashes. func openConversation(userId: Int) { let messageViewController = JSQMessagesViewController(); self