ZHChat icon indicating copy to clipboard operation
ZHChat copied to clipboard

Photo and Audio Message are showing with current date only?

Open imran233113 opened this issue 7 years ago • 9 comments

I would like to suggest this code for compress image -

#pragma mark - ZHCMessageMediaData protocol

- (UIView *)mediaView
{
    if (self.image == nil) {
        return nil;
    }
    
    if (self.cachedImageView == nil) {
        CGSize size = [self mediaViewDisplaySize];
        UIImageView *imageView = [[UIImageView alloc] initWithImage:self.image];
        imageView.contentMode = UIViewContentModeScaleAspectFill;
        imageView.frame = CGRectMake(0.0f, 0.0f, size.width, size.height);

        imageView.clipsToBounds = YES;
        [ZHCMessagesMediaViewBubbleImageMasker applyBubbleImageMaskToMediaView:imageView isOutgoing:self.appliesMediaViewMaskAsOutgoing];
        self.cachedImageView = imageView;
    }
    
    return self.cachedImageView;
}

imran233113 avatar Apr 12 '17 12:04 imran233113

Thank you for your feedback, picture loading is due to the image link for HTTP causes, has been repaired. As for recording sound, do you open the microphone permissions in the system settings?

zhuozhuo avatar Apr 13 '17 06:04 zhuozhuo

Hi Thanks for reply,

My admin is sending me image+message or Audio+message together, in that case messages are not displaying. I want to see image and message or audio with message. Is it possible ?

imran233113 avatar Apr 13 '17 06:04 imran233113

This is achievable, you just follow the ZHCMessageMediaData protocol or inherit the ZHCMediaItem custom you need to MediaItem!

zhuozhuo avatar Apr 13 '17 07:04 zhuozhuo

HI, i could not get custom to add in ZHCMediaItem . could you update with code please

imran233113 avatar Apr 13 '17 07:04 imran233113

Yes, you can't customize ZHCMediaItem directly. You must write a class and inherit from ZHCMediaItem. You can refer to the ZHPhotoItem in the Demo.

zhuozhuo avatar Apr 13 '17 07:04 zhuozhuo

thanks i will check if any thing i will revert back to you.. thanks a lot

imran233113 avatar Apr 13 '17 07:04 imran233113

Hi It will take time for me write the code of your level really. If you could update me with code how could i add image+test that would be good and thankful to you.

imran233113 avatar Apr 13 '17 07:04 imran233113

Sorry, in the busy other things! Temporarily can't spare time to help you!

zhuozhuo avatar Apr 13 '17 08:04 zhuozhuo

ok once you are free, please update it. thanks

imran233113 avatar Apr 13 '17 08:04 imran233113