Comments (9)
Thanks for the feedback. I'll take a look.
from phoenix_wings.
Hey @gmlewis Could you share the flutter code you were using to try and connect?
As far as I can tell the payload is correct.
I used this https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/socket/serializers/v2_json_serializer.ex#L12-L39 as the reference for structuring the payload.
from phoenix_wings.
Thanks, @mfeckie. I'm requesting permission to share my example. I'll report when I hear back.
from phoenix_wings.
It seems that your project is using the v1 serializer instead of the v2.
See: https://github.com/phoenixframework/phoenix/blob/master/lib/phoenix/socket/serializers/v1_json_serializer.ex#L13
I'm not sure in which Phoenix version they updated to the v2 json serializer. I think it is configurable somewhere. What Phoenix version are you using? Any chance to upgrade?
from phoenix_wings.
Oh! I see what you are saying. I used this chat application:
https://github.com/stevegrossi/phoenix_chat/blob/master/mix.exs#L33
and that looks like Phoenix 1.2.
I'll see if I can upgrade. Thanks, @philipgiuliani!
from phoenix_wings.
Starting with the mix.exs
file from the last comment, I updated the deps
to this:
defp deps do
[{:phoenix, "~> 1.3.2"},
{:phoenix_pubsub, "~> 1.0"},
{:phoenix_ecto, "~> 3.2"},
{:plug, "~>1.5.1"}, # GML
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.10"},
{:phoenix_live_reload, "~> 1.0", only: :dev},
{:gettext, "~> 0.11"},
{:cowboy, "~> 1.0"}]
end
Does this look correct?
If it does, then I'm surprised that my (modified) phoenix_wings
still works!
I also added Phoenix Presence support and it seems to work.
I need to do a code review at work and hopefully soon I can share my changes.
from phoenix_wings.
Without seeing more of the application you're building it's not possible to know what serializer is being used.
from phoenix_wings.
I believe I have finally figured out what is going on.
The phoenix_chat server sends payload messages that are simple strings and not maps.
When I make these changes to phoenix_wings, I'm able to use it with the phoenix_chat
server.
As an aside, I went ahead and implemented PhoenixPresence
by translating the JavaScript phoenix.js
to Dart.
Let me know if you would like a PR for the Map
-> dynamic
changes.
from phoenix_wings.
I'm gonna close this as stale now, but PR for Map -> dynamic still welcome
from phoenix_wings.
Related Issues (14)
- Add Phoenix.Presence HOT 6
- Heartbeat HOT 3
- StreamSink is closed HOT 3
- why endpoint from WS://****** to http://****** HOT 9
- Does not support flutter web. HOT 4
- Null Safety HOT 5
- Unhandled Exception HOT 4
- Channel off wrong event
- PhoenixChannel causing Unhandled Exception
- socketOptions won't accept more than 1 param
- Dart 2 compability
- socket.disconnect does not stop the connect loop HOT 4
- onClose was called on null HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phoenix_wings.