Skip to content
This repository has been archived by the owner on Jun 12, 2023. It is now read-only.

当收到新消息时,监听器没有收到枚举类型为 ListenerTypeEnum.NewMessages的触发事件 #12

Closed
yuefeng007 opened this issue Apr 3, 2020 · 22 comments
Labels
help wanted Extra attention is needed

Comments

@yuefeng007
Copy link

yuefeng007 commented Apr 3, 2020

但是 ListenerTypeEnum.RefreshConversation 是正常被触发的
版本 tencent_im_plugin: ^0.2.19

@JiangJuHong
Copy link
Owner

我这里没有复现这个问题,请检查控制台是否打印了错误日志

@yuefeng007
Copy link
Author

没有错误 。只是 没有触发这个枚举,我是通过ios模拟器发送的消息 不知道有没有影响。github的demo 我也试过 确实没有触发 监听

@yuefeng007
Copy link
Author

仅仅监听到了会话列表用到的 ListenerTypeEnum.RefreshConversation 刷新事件

@JiangJuHong
Copy link
Owner

你是在IOS设备上测试的吗

@yuefeng007
Copy link
Author

ios 模拟器 发送消息,这边安卓真机测试 接收消息

@yuefeng007
Copy link
Author

这个功能之前是好使的。我试过

@JiangJuHong
Copy link
Owner

因为我身边现在没有Android设备,请帮忙确认 IOS -> IOS 能否收到消息

@yuefeng007
Copy link
Author

没事,但是 这个预计要明天中午才能回复你,因为我的ios真机调试 还存在问题 预计明天会跑通

@JiangJuHong
Copy link
Owner

好的,如果这个问题存在,我将尽快修复!

@yuefeng007
Copy link
Author

ok,感谢。

@JiangJuHong JiangJuHong added the help wanted Extra attention is needed label Apr 3, 2020
@yuefeng007
Copy link
Author

yuefeng007 commented Apr 4, 2020

android->android
ios->ios
ios->android
android->ios
都没有 ListenerTypeEnum.NewMessages的触发事件

@iyuhang
Copy link

iyuhang commented Apr 4, 2020

我测试

android->android

能收到 ListenerTypeEnum.NewMessages的触发事件

@JiangJuHong
Copy link
Owner

@iyuhang 感谢提供帮助。
@yuefeng007 我也没能复现这个问题,请仔细检查代码逻辑,确认登录状态。

@yuefeng007
Copy link
Author

yuefeng007 commented Apr 4, 2020

就这么一段代码,暂时我没想到该去检查什么地方,除了前端还有别的地方可能影响吗

TencentImPlugin.addListener(listener);
  listener(type, params) {
    print('chat_detail 详情页面listener被触发  --start------------------');
    print('listener被触发,消息类型为 ${type}');
    print('chat_detail 详情页面listener被触发  --end---');
  }

log日志

I/flutter (23726): chat_detail 详情页面listener被触发  --start------------------
I/flutter (23726):listener被触发,消息类型为 ListenerTypeEnum.Refresh
I/flutter (23726): chat_detail 详情页面listener被触发  --end---
I/flutter (23726): chat_detail 详情页面listener被触发  --start------------------
I/flutter (23726):listener被触发,消息类型为 ListenerTypeEnum.RefreshConversation
I/flutter (23726): chat_detail 详情页面listener被触发  --end---

@JiangJuHong
Copy link
Owner

你测试的是群聊还是单聊?还是所有的都收不到?

@yuefeng007
Copy link
Author

yuefeng007 commented Apr 4, 2020

单聊。有没有可能是IM服务的原因,我下载了 im的demo。仍然是一样的现象。另外我是想方不方便在 demo中增加两个测试身份。开发人员能否 作为临时测试im服务使用。不然有的后端真的很坑

@JiangJuHong
Copy link
Owner

Demo中使用的是我们个人的账号,后期会被移除,建议自行通过腾讯云IM申请appid,然后进行测试。
未收到消息的问题我会再次尝试是否复现

@yuefeng007
Copy link
Author

我认为很大可能是我们后端服务有问题。感谢作者,,我自己想办法再测测吧

@yuefeng007
Copy link
Author

终于定位到原因了,想想也是挺坑的。根本原因在后端那边更换了im服务,又设置了必须加好友双方才能互收消息。

@JiangJuHong
Copy link
Owner

哈哈,解决了就好!

@shen-lan
Copy link

老哥 我也遇到乐这个问题

//初始进入页面
收到的消息类型是》》》》》ListenerTypeEnum.Refresh
---------------------------------------


//手动刷新
收到的消息类型是》》》》》ListenerTypeEnum.RefreshConversation

页面是按照demo搭建的。

收不到新消息

image

@JiangJuHong
Copy link
Owner

请尝试在Demo中更换至你的appid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants