注册

Android 无法关闭 消息提示音和振动。 HX版本 V2.2.0


initHXOptions(){
   EMChatOptions options = EMChatManager.getInstance().getChatOptions();   ...
   options.setNotificationEnable(false); 
   options.setNoticedByVibrate(false); 
   options.setNoticeBySound(false); 
   options.setNotifyBySoundAndVibrate(false);
   ...
   EMChatManager.getInstance().setChatOptions(options);
}
这样设置 还不够吗?
已排除 android notification 自身的提示音和振动 (已注释 notification build 代码)
测试机 小米3联通版  android 4.4.4
已邀请:
这些代码需要放到sdk初始化之后,再看看所有的消息监听onevent里有没有去调用onNewMsg或者viberateAndPlayTone方法

chuaxiansky - 90后IT男

好吧, 通过 hxSDKHelper->hxSDKMODEL.setSettingMsgNotification(boolean flag) 这个方法来 设置。
因为 Demo里 发消息的 振动和提醒, 是 hxSDKMODEL 来控制的。
onNewMsg 和 viberateAndPlayTone 的实现逻辑 在这里面。 跟Options 没关系了

要回复问题请先登录注册