我有这个网址
myString = file:///var/mobile/Containers/Data/PluginKitPlugin/-------/Documents/MyAudio.m4a
这是我的发送代码
MSConversation * conversation = self.activeConversation;
if (conversation) {
MSMessageTemplateLayout * activeLayout = [[MSMessageTemplateLayout alloc] init];
// activeLayout.image = image;
activeLayout.caption = @"Message Counter";
activeLayout.subcaption = @"Message subcaption";
activeLayout.trailingCaption = @"Trailing caption";
activeLayout.trailingSubcaption = @"Trailing Subcaption";
activeLayout.mediaFileURL = [NSURL URLWithString:myString];
activeLayout.imageTitle = @"Image counter";
activeLayout.imageSubtitle = @"Image subtitle";
MSMessage * message = [[MSMessage alloc] init];
message.layout = activeLayout;
message.URL = [NSURL URLWithString:@"Empty URL"];
message.summaryText = @"This is Summary";
[conversation insertMessage:message completionHandler:^(NSError *error) {
if (error) {
NSLog(@"Error sending message %@", [error localizedDescription]);
}
}];
}
else {
NSLog(@"No &%#%&^# conversation found");
}
我无法获取要发送的音频文件,我只有消息计数器等。