简体   繁体   English

使用okhttp3 android在Ruby ActionCable频道室订阅

[英]Subscribe on Ruby ActionCable channel room using okhttp3 android

I'm trying to create simple chat on android and i have ruby server-side application. 我正在尝试在android上创建简单的聊天,并且我有ruby服务器端应用程序。 ActionCable chat is working (tested via browser). ActionCable聊天正在进行(通过浏览器测试)。 The question is how can i subscribe on the special channel room using okhttp3 android library like it done using cable.js (browser screen)? 问题是如何像使用cable.js(浏览器屏幕)一样使用okhttp3 android库在特殊频道室进行订阅?

ruby server 红宝石服务器

android client Android客户端

browser 浏览器

You should look how js client is implemented and send messages according to undocumented actioncable protocol 您应该查看js客户端的实现方式,并根据未记录的actioncable协议发送消息

To subscribe 认购

{"command":"subscribe","identifier":"{\"channel\":\"ChatChannel\"}"}

You can watch from chrome browser the websocket frames 您可以从Chrome浏览器观看websocket框架

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM