jmessage-react-plugin processApplyJoinGroup 无法使用

jmessage
标签: #<Tag:0x00007fb834a03338>

(Josh Lipan) #22

你现在在同一个页面直接处理群申请也不行吗?


(ecdevelop) #23

processApplyJoinGroup 拒绝群后,用户再申请入群提示 repeat invite or apply code:856003 这种怎么处理?还有消息错过之后,用户也是没办法再申请入群~~ @JoshLipan


(ecdevelop) #24

没有邀请入群的API


(Josh Lipan) #25

1.用户确定是在收到 addReceiveGroupAdminRejectListener 被拒绝事件后重新发起的申请吗
2.消息监听最好放在全局来做
3.有对应API addGroupMembersremoveGroupMembers,我们会尽快完善文档


(ecdevelop) #26

addReceiveGroupAdminRejectListener 拒绝监听不到 addReceiveGroupAdminApprovalListener 同意的可以监听到 会有这种情况?


(Josh Lipan) #27

看下你拒绝事件监听代码怎么写的


(ecdevelop) #28

正在聊天的两个用户从聊天退出后未读的消息个数应该是0,但是未读变成两个用户聊天的条数,这是你们的没处理好吗? @JoshLipan


(ecdevelop) #29

%E5%9B%BE%E7%89%87 添加群组的功能崩溃了~


(Josh Lipan) #30

需要自己手动重置 resetUnreadMessageCount。不同的问题请分开提问~


(ecdevelop) #31

不好意思没看到这个接口~


(12) #32

官网问题已恢复


(ecdevelop) #33

@JoshLipan addReceiveMessageListener 试了很多次同意的监听的到,拒绝的监听不到,
message.eventType group_member_added 收的到,看下是什么问题

//监听接收消息
        JMessage.addReceiveMessageListener((message) => {
            console.log('addReceiveMessageListener', message);
        })

//监听加群事件
       JMessage.addReceiveApplyJoinGroupApprovalListener((event) => {
            console.log('addReceiveApplyJoinGroupApprovalListener',event);
            Alert.alert(
              '加群审核',
              event.reason,
              [
                {text: '拒绝', onPress: () => this.reject(event)},
                {text: '同意', onPress: () => this.approval(event) },
              ],
              { cancelable: false }
            )
       });
//同意
approval(event){
        console.log('approval')
        JMessage.processApplyJoinGroup({ events: [event.eventId], isAgree: true, reason: '同意', isRespondInviter: true },
          () => {
            console.log('同意')
          }, (error) => {
            console.log(error)
            alert(JSON.stringify(error))
          })
    }
//拒绝
    reject(event){
        console.log('reject')
          JMessage.processApplyJoinGroup({ events: [event.eventId], isAgree: false, reason: '拒绝', isRespondInviter: true },
          () => {
             console.log('拒绝')
          }, (error) => {
            console.log(error)
            alert(JSON.stringify(error))
          })
    }

(Josh Lipan) #34

不好意思,找到原因了,Android 原生对群批量拒绝的处理是直接忽略(类似微信),所以这边收不到群拒绝消息。
请更新插件版本 v2.5.3 ,插件对拒绝处理增加了循环单独处理,现在应该可以收到拒绝事件了。


(ecdevelop) #35

@JoshLipan
Object { usernames: (1) […], eventType: “group_member_exit”, type: “event”, unreceiptCount: 0, createTime: 1544173335530, extras: {}, target: {…}, from: {…}, serverMessageId: “313278108”, id: “6” }
Object { usernames: (1) […], eventType: “group_member_added”, type: “event”, unreceiptCount: 0, createTime: 1544173468716, extras: {}, target: {…}, from: {…}, serverMessageId: “311138241”, id: “1” }
Object { usernames: [], eventType: “group_dissolved”, type: “event”, unreceiptCount: 0, createTime: 1544173831079, extras: {}, target: {…}, from: {…}, serverMessageId: “313280788”, id: “2” }
就是收不到拒绝的,还有个问题就是如果没立即处理请求,后面用户就无法再申请了,这种怎么解决~~