|
[插件使用]
融云2,设置消息接收状态,IOS可以设置静音,安卓设置无效
[复制链接]
融云2,设置消息接收状态,IOS可以设置静音,安卓设置无效
以下是相关代码:
- //获取某个会话的通知状态
- function getConversationNotificationStatus($targetId,$messageType){
- rong.getConversationNotificationStatus({
- conversationType: $messageType,
- targetId: ''+$targetId+''
- }, function (ret, err) {
- if (ret.status == 'success'){
- api.sendEvent({
- name : 'setNotificationText',
- extra : {
- status : ret.result.notificationStatus,
- code : ret.result.code
- }
- })
- }
- })
- }
- //设置某个会话的通知状态
- function setConversationNotificationStatus($targetId,$status,$messageType){
- rong.setConversationNotificationStatus({
- conversationType:''+$messageType+'',
- targetId: ''+$targetId+'',
- notificationStatus: ''+$status+''
- }, function (ret, err) {
- //alert('1:'+JSON.stringify(ret));
- //alert('2:'+JSON.stringify(err));
- if (ret.status == 'success'){
- api.sendEvent({
- name : 'setNotificationText',
- extra : {
- status : ret.result.notificationStatus,
- code : ret.result.code
- }
- })
- }
- })
- }
复制代码
|
|