Skip to content

Commit 51ad6e1

Browse files
committed
fix jmessage sendImageMessage format
1 parent 89b9339 commit 51ad6e1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ios/RCTJMessageModule/RCTJMessageModule.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ - (JMSGMessage *)createMessageWithDictionary:(NSDictionary *)param type:(JMSGCon
208208
return nil;
209209
}
210210
content = [[JMSGImageContent alloc] initWithImageData: [NSData dataWithContentsOfFile: mediaPath]];
211-
211+
JMSGImageContent *imgContent = content;
212+
imgContent.format = [mediaPath pathExtension];
212213
break;
213214
}
214215
case kJMSGContentTypeVoice:{
@@ -251,6 +252,8 @@ - (JMSGMessage *)createMessageWithDictionary:(NSDictionary *)param type:(JMSGCon
251252
}
252253

253254
content = [[JMSGFileContent alloc] initWithFileData:[NSData dataWithContentsOfFile: mediaPath] fileName: fileName];
255+
JMSGFileContent *fileContent = content;
256+
fileContent.format =[mediaPath pathExtension];
254257
break;
255258
}
256259
case kJMSGContentTypeCustom:{

0 commit comments

Comments
 (0)