kesha-antonov / react-native-action-cable

Use Rails 5+ ActionCable channels with React Native for realtime magic.
https://www.npmjs.com/package/@kesha-antonov/react-native-action-cable
MIT License
58 stars 24 forks source link

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

Open awahab94 opened 4 years ago

awahab94 commented 4 years ago

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?

Screenshot 2019-12-29 at 6 10 01 PM
kesha-antonov commented 4 years ago

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

awahab94 commented 4 years ago

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

jpmazza commented 4 years ago

+1

cini9 commented 3 years ago

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 commented 3 years ago

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 !

kesha-antonov commented 3 years ago

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!