【问题标题】:send a voice message as attachment with applozic android使用applozic android发送语音消息作为附件
【发布时间】:2016-08-01 08:28:44
【问题描述】:

我正在使用 applozic api,但我在文档中找不到如何将 语音消息 作为附件发送。

import com.applozic.mobicomkit.api.conversation.MobiComConversationService;

 public void sendMessage(Message message)        
 {             
   ...        
 }

new MobiComConversationService(activity).sendMessage(new     
Message("contact@applozic.com", "hello test"));


 public synchronized List<Message> getLatestMessagesGroupByPeople()        
 {            
  ...         
 }

 public List<Message> getMessages(String userId, Long startTime, Long endTime)        
 {            
  ...           
 }

【问题讨论】:

    标签: android chat voice applozic


    【解决方案1】:

    发送语音消息有两种方式:

    1. 直接方式: 创建消息对象,设置要发送消息的userId,设置语音消息文件的文件路径,用户内容Type Message.ContentType.AUDIO_MSG.getValue()。

      Message message = new Message();
      message.setTo("userId");//Replace userId with user whom u want send a audio message
      List<String> filePathsList = new ArrayList<String>();
      filePathsList.add(filePath);//set the file path where the audio file is stored
      message.setFilePaths(filePathsList);
      message.setContentType(Message.ContentType.AUDIO_MSG.getValue());
      new MobiComConversationService(context).sendMessage(message);
      
    2. UI 工具包: 点击附件选项图标 --> 选择音频 --> 录制语音并发送语音消息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-19
      • 2013-02-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多