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、安卓等非网页端链接的问题 #19

Open
luobingbing0207 opened this issue Apr 8, 2020 · 8 comments
Open

关于iOS、安卓等非网页端链接的问题 #19

luobingbing0207 opened this issue Apr 8, 2020 · 8 comments

Comments

@luobingbing0207
Copy link

巨佬。。我在网页端能实现IM功能了。。那么请问该如何在iOS、安卓的那个非网页端 来通过webSocket来和 IM展开通讯呢?

@2881099
Copy link
Owner

2881099 commented Apr 8, 2020

ios android,都有对应的 websocket client 库

@luobingbing0207
Copy link
Author

我使用的是 SRWebSocket,SocketRocket 是facebook下对websocket的封装,然后在链接时卡住了,self.webScoket = [[SRWebSocket alloc] initWithURL:[NSURL URLWithString:@"ws://127.0.0.1:6379/ws/pre-connect"]];,,是否是该url链接设置的不对??若不对,应该怎么的拼写规则呢??网页端倒是能直接拿您的demo的方法直接调用。

@2881099
Copy link
Owner

2881099 commented Apr 8, 2020

pre-connect 要用 httpclient 请求,会返回 ws 连接

再用 websocket 连

@luobingbing0207
Copy link
Author

。。。黑人问号???。。。大佬能给一个范例么??或者一个链接之类的

@2881099
Copy link
Owner

2881099 commented Apr 8, 2020

第一步,http请求 pre-connect 接口

第二步,用第一步返回的数据,看看他的内容,使用 websocket 连接

@luobingbing0207
Copy link
Author

哦哦。。好的。。我去试试,,感谢大佬

@luobingbing0207
Copy link
Author

巨佬就是牛逼。。。弱弱的问一个问题。。我看到你都是基于Guid来操作的。。能否切换到我自己的 ID格式呢??

@2881099
Copy link
Owner

2881099 commented Apr 8, 2020

把id 和guid对应关联一下就行了,没必要改

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

2 participants