I'm adding a send picture feature to my app using SendBird.
On - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
I execute this code
NSData *imageFileData = UIImageJPEGRepresentation(info[UIImagePickerControllerOriginalImage], 0.5);
NSURL* imagePath = [info objectForKey:@"UIImagePickerControllerReferenceURL"];
NSString* imageName = [imagePath lastPathComponent];
[self.currentChannel sendFileMessageWithBinaryData:imageFileData filename:imageName type:@"image/jpg" size:[imageFileData length] data:nil completionHandler:^(SBDFileMessage * _Nullable fileMessage, SBDError * _Nullable error) {}];
This code works well when the imagePicker's sourcetype is: UIImagePickerControllerSourceTypePhotoLibrary
.
If I send an image with imagePicker which's sourcetype is: UIImagePickerControllerSourceTypeCamera
then
- (void)channel:(SBDBaseChannel *)sender didReceiveMessage:(SBDBaseMessage *)message
is never triggered.