diff --git a/ios/RCTJMessageModule/RCTJMessageModule.m b/ios/RCTJMessageModule/RCTJMessageModule.m index cb6165c..c6de36f 100644 --- a/ios/RCTJMessageModule/RCTJMessageModule.m +++ b/ios/RCTJMessageModule/RCTJMessageModule.m @@ -208,7 +208,8 @@ - (JMSGMessage *)createMessageWithDictionary:(NSDictionary *)param type:(JMSGCon return nil; } content = [[JMSGImageContent alloc] initWithImageData: [NSData dataWithContentsOfFile: mediaPath]]; - + JMSGImageContent *imgContent = content; + imgContent.format = [mediaPath pathExtension]; break; } case kJMSGContentTypeVoice:{ @@ -251,6 +252,8 @@ - (JMSGMessage *)createMessageWithDictionary:(NSDictionary *)param type:(JMSGCon } content = [[JMSGFileContent alloc] initWithFileData:[NSData dataWithContentsOfFile: mediaPath] fileName: fileName]; + JMSGFileContent *fileContent = content; + fileContent.format =[mediaPath pathExtension]; break; } case kJMSGContentTypeCustom:{