I'm trying to send an mp4 video using an MSMessage from a MessageExtension.
When using the following code :
//Initializate an MSSticker
NSError* error = nil;
NSURL* stickerURL = [[NSBundle mainBundle] URLForResource:@"image" withExtension:@"png"];
MSSticker* sticker = [[MSSticker alloc] initWithContentsOfFileURL:stickerURL localizedDescription:@"" error:&error];
//Initialize an MSStickerView
MSStickerView* stickerView = [[MSStickerView alloc] initWithFrame:CGRectMake(0, 0, 65, 65)];
stickerView.sticker = sticker;//<-- this line creates the side effect issue
//Send an attachement
NSURL* fileUrl = [[NSBundle mainBundle] URLForResource:@"video" withExtension:@"mp4"];
[[[MSConversation alloc] init] insertAttachment:fileUrl withAlternateFilename:nil completionHandler:^(NSError * error) {
}];
No error is raised, all files exist properly.
But then I get the following result :
If I remove the line stickerView.sticker = sticker;
, then everything works properly and the video is sent.
Any idea how to fix it ?