注册

无法获得好友请求消息

登陆成功后 调用下面方法,但是好友请求(onContactInvited)从来没有被执行。

EMContactManager.getInstance().setContactListener(new MyContactListener());
EMChat.getInstance().setAppInited();


class MyContactListener implements EMContactListener() { @Override public void onContactAgreed(String username) { //好友请求被同意 } @Override public void onContactRefused(String username) { //好友请求被拒绝 } @Override public void onContactInvited(String username, String reason) { //收到好友邀请 } @Override public void onContactDeleted(List usernameList) { //被删除时回调此方法 } @Override public void onContactAdded(List usernameList) { //增加了联系人时回调此方法 }}

已邀请:

hongyan

赞同来自: wzsxlh

有在注册好友监听之后写EMChat.getInstance().setAppInited();这句吗?
执行要看条件满足了没
> forum.php?mod=redirect&goto=findpost&pid=4222&ptid=2220
执行要看条件满足了没


什么条件啊 亲
我登录成功了,登陆的用户和请求好友的用户在环信后台网页注册了,并且他们之间没有好友关系。 还有其他的什么吗?
请求发送成功了没
> forum.php?mod=redirect&goto=findpost&pid=4243&ptid=2220
请求发送成功了没


我只想说 环信的文档写的好垃圾!!!
> forum.php?mod=redirect&goto=findpost&pid=4303&ptid=2220
我只想说 环信的文档写的好垃圾!!!


额,那就照着demo看吧
楼主解决了吗?我也遇到这个问题了..不回调public void onContactInvited(String username, String reason) 啊!

lizg - ……

本帖最后由 hblzg123 于 2015-6-10 12:03 编辑

> forum.php?mod=redirect&goto=findpost&pid=5129&ptid=2220
楼主解决了吗?我也遇到这个问题了..不回调public void onContactInvited(String username, String reason) ...

初始化的时候,有设置添加好友需要验证么 options.setAcceptInvitationAlways(false);
> forum.php?mod=redirect&goto=findpost&pid=5171&ptid=2220
初始化的时候,有设置添加好友需要验证么 options.setAcceptInvitationAlways(false);
...


HXSDKHelper这个一定要吗?因为我之前实现了用环信聊天的功能都不要实现这个抽象类的继承

lizg - ……

> forum.php?mod=redirect&goto=findpost&pid=5212&ptid=2220
HXSDKHelper这个一定要吗?因为我之前实现了用环信聊天的功能都不要实现这个抽象类的继承 ...


不是一定需要,也可以自己写,这个帮助类可以提高开发速度,很多东西他都做了
> forum.php?mod=redirect&goto=findpost&pid=5212&ptid=2220
HXSDKHelper这个一定要吗?因为我之前实现了用环信聊天的功能都不要实现这个抽象类的继承 ...


结果..我在 Application中设置了 EMChat.getInstance().init(this);
EMChatManager.getInstance().getChatOptions().setAcceptInvitationAlways(false);也是收不到回调额

lizg - ……

> forum.php?mod=redirect&goto=findpost&pid=5225&ptid=2220
结果..我在 Application中设置了 EMChat.getInstance().init(this);
EMChatManager.getInstance().getC ...


其他的收的到吗
> forum.php?mod=redirect&goto=findpost&pid=5231&ptid=2220
其他的收的到吗


聊天的消息可以收到。新消息的广播也收的到并更新界面..就加好友邀请可以发却收不到

要回复问题请先登录注册