dwyl / learn-flutter

🦋 Learn how to use Flutter to Build Cross-platform Native Mobile Apps
https://flutter.dev
GNU General Public License v2.0
87 stars 8 forks source link

Flutter and Phoenix channels #61

Open th0mas opened 4 years ago

th0mas commented 4 years ago

Flutter/Dart currently only has one Phoenix client library so we have two approaches to integrate Flutter and Phoenix:

nelsonic commented 4 years ago

@th0mas see how far you can get with phoenix_wings and leave comments on this issue with your progress. If you hit a brick wall, please open an issue on https://github.com/mfeckie/phoenix_wings/issues and link to it from here. Groking the source will be informative if you decide to re-implement it.

th0mas commented 4 years ago

phoenix_wings should work well. I can't see any large feature difference between that and the reference phoenix.js implementation. If we do find one, I'm sure it will be easily patched.

nelsonic commented 4 years ago

Crucially we need to have a library that knows to avoid attempting to reconnect when the devices is offline and automatically reconnects when there is a connection, so it may need to be aware of connection status #3. Also, having a heartbeat could be useful for presence https://github.com/mfeckie/phoenix_wings/issues/10 as we want to know "Who's Online?"

th0mas commented 4 years ago

This library does seem to have Presence support (https://pub.dev/documentation/phoenix_wings/latest/html/PhoenixPresence-class.html) so that shouldn't be a problem.

I'll check for online/offline callbacks.

SimonLab commented 1 year ago

Just had a look at the phoenix_wings repository, the last updated was a while ago now: image

With the newest version of Phoenix I'm not sure if this library is still compatible.

nelsonic commented 1 year ago

@SimonLab yeah, the top result when searching for google.com/search?q=flutter+phoenix+channels Is no longer phoenix_wings ...

google-phoenix-flutter-channels

It's phoenix_socket: https://pub.dev/packages/phoenix_socket

image

Which has recent activity/contribution: https://github.com/braverhealth/phoenix-socket-dart

image

It has a "corporate sponsor" in the form of: https://braver.net/en/

image

And the lead dev @matehat seems to know what he's doing. 👌

image

This is the approach/route I would take. 💭

nelsonic commented 1 year ago

Quick issue https://github.com/braverhealth/phoenix-socket-dart/issues/ and PR to test https://github.com/braverhealth/phoenix-socket-dart/pull/57 receptiveness to future contributions. 😉

nelsonic commented 1 year ago

GOTO: https://github.com/dwyl/flutter-phoenix-channels-demo/issues/1

nesimtunc commented 4 months ago

Is there any issue? I wonder if anyone using it in production one of those libraries?