首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >消息扩展发送音频文件

消息扩展发送音频文件
EN

Stack Overflow用户
提问于 2017-02-10 16:41:24
回答 1查看 177关注 0票数 0

我有这个网址

file:///var/mobile/Containers/Data/PluginKitPlugin/-------/Documents/MyAudio.m4a = myString

这是我的发送代码

代码语言:javascript
复制
  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");
    }

我无法获得发送的音频文件,我只有消息计数器等等。

EN

回答 1

Stack Overflow用户

发布于 2017-04-24 05:11:35

不要使用insertMessage -[[会话插入攻击:NSURL:myString;withAlternateFilename:@“备用名称”completionHandler:^(NSError * error) {DDLogInfo(@error is %@,error);}];

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42164428

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档