Skip to content

Commit

Permalink
fix jmessage sendImageMessage format
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminlinux committed Jan 24, 2018
1 parent 89b9339 commit 51ad6e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ios/RCTJMessageModule/RCTJMessageModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -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:{
Expand Down Expand Up @@ -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:{
Expand Down

0 comments on commit 51ad6e1

Please sign in to comment.