I am developing a simple chat application using react-native-actioncable , but unfortunately it only works in android.
constructor(props) { super(props); let self = this; self.App = {}; self.App.cable = ActionCable.createConsumer('wss://xyz/cable'); self.App.room_chat = self.App.cable.subscriptions.create({ channel: "ChatChannel", room: "chat_1" }, { connected: function () { alert('connected'); console.log("connected") }, disconnected: function () { alert('connected'); console.log("connected") }, received: function (data) { }, rejected: function (data) { console.log("rejected", data) }, sendMessage: function (message, id) { console.log("sendMessage") return this.perform('speak', {message: message, group_id: "chat_" + id}); } }); }
After some investigation, I found that the problem is that the associated callback is never called, which means that my channel is not even connected. this is behavior on iOS .
I am also tired of SWIFT / ObjectC, and it also does not work, I believe that the problem is in my backend, but I donβt know how?
Any help!
source share