Giter Site home page Giter Site logo

Comments (9)

mfeckie avatar mfeckie commented on July 18, 2024

Thanks for the feedback. I'll take a look.

from phoenix_wings.

mfeckie avatar mfeckie commented on July 18, 2024

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.

gmlewis avatar gmlewis commented on July 18, 2024

Thanks, @mfeckie. I'm requesting permission to share my example. I'll report when I hear back.

from phoenix_wings.

philipgiuliani avatar philipgiuliani commented on July 18, 2024

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.

gmlewis avatar gmlewis commented on July 18, 2024

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.

gmlewis avatar gmlewis commented on July 18, 2024

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.

mfeckie avatar mfeckie commented on July 18, 2024

Without seeing more of the application you're building it's not possible to know what serializer is being used.

from phoenix_wings.

gmlewis avatar gmlewis commented on July 18, 2024

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.

mfeckie avatar mfeckie commented on July 18, 2024

I'm gonna close this as stale now, but PR for Map -> dynamic still welcome

from phoenix_wings.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.