react-native-action-cable icon indicating copy to clipboard operation
react-native-action-cable copied to clipboard

Channel callbacks [connected, disconnected , received & rejected ] not trigging?

Open awahab94 opened this issue 5 years ago • 6 comments

Hi @kesha-antonov, I am new to action cable with react native. could you help to fix this issue? My Channel callbacks it not triggered so I don't is my APP connected or not?

  • ActionCable.startDebugging() Logs are
Screenshot 2019-12-29 at 6 10 01 PM
  • I do logs actionCable.connection.isActive() it prints true and if i do actionCable.disconnected() it will print false. Thanks.

awahab94 avatar Dec 29 '19 13:12 awahab94

@abdulwahabcs Hi! Are you sure you setup server correctly? There's error with something about unsupported protocols

kesha-antonov avatar Dec 29 '19 14:12 kesha-antonov

@kesha-antonov Thanks for replying i think you are right i had issue on my server side. Can you shar something to setup server?

awahab94 avatar Dec 30 '19 07:12 awahab94

+1

jpmazza avatar Jun 19 '20 20:06 jpmazza

Hi everyone, and thanks @kesha-antonov for the package ! Did anybody find a solution for this ? I can't seem to even connect to the channel.

My Chat screen (react-native)

Screenshot 2020-12-17 at 10 16 49

My Conversation Channel (Rails)

Screenshot 2020-12-17 at 10 18 35

My Rails console logs (seems that it keeps trying to connect... unsuccessfully)

Screenshot 2020-12-17 at 10 20 31

When I start debugging with ActionCable.startDebugging(), my console just shows

Screenshot 2020-12-17 at 10 22 33

Am I missing any other configurations that might impact the connection ? Anything in routes or config or anything ?

cini9 avatar Dec 17 '20 09:12 cini9

For those who encounter a similar issue, I have figured out the reason that the client could not connect to the server.

In my development.rb file, I had a configuration line specifying config.reload_classes_only_on_change = false

After removing this line, my mobile app could finally connect to the backend.

Thanks again @kesha-antonov for the lib !

cini9 avatar Dec 18 '20 09:12 cini9

For those who encounter a similar issue, I have figured out the reason that the client could not connect to the server.

In my development.rb file, I had a configuration line specifying config.reload_classes_only_on_change = false

After removing this line, my mobile app could finally connect to the backend.

Thanks again @kesha-antonov for the lib !

Thanks for sharing your solution!

kesha-antonov avatar Dec 18 '20 11:12 kesha-antonov