Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于实现 ios和安卓同时在线遇到的问题 #130

Closed
tangtaoit opened this issue Apr 19, 2024 · 1 comment
Closed

关于实现 ios和安卓同时在线遇到的问题 #130

tangtaoit opened this issue Apr 19, 2024 · 1 comment

Comments

@tangtaoit
Copy link
Contributor

就是我们想的是ios和安卓端可以同时在线
我们后台逻辑和数据都看了是正确的..但是前端老是会弹出连接失败 reason=ReasonAuthFail。
我们先是安卓登录 标记为主设备
然后ios登录 标记为从设备

但是每次ios登录一会儿后,安卓就会弹出登录,看到im打印的日志就是 {"level":"error","time":"2024-04-19 09:47:07","msg":"【Processor】token verify fail","expectToken":"安卓token","actToken":"IOStoken","conn":"Conn[11] uid= fd={49} deviceFlag=APP deviceLevel=Slave deviceID="}

@tangtaoit
Copy link
Contributor Author

tangtaoit commented Apr 19, 2024

出现这种情况是因为你iOS冲掉了Android的token,因为你device_flag是一样的

可以通过以下方式实现同时在线:

将 device_level设置为1(从设备) device_flag给一个标识。比如 Android为4,iOS为5

android登录的时候 /user/token 接口的device_flag给4,iOS登录的时候给5

android前端 连接IM的时候device_flag设置为4
iOS前端 连接IM的时候device_flag设置为5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant