GithubHelp home page GithubHelp logo

Step 9: add offline mode about chatty HOT 4 OPEN

srtucker22 avatar srtucker22 commented on May 15, 2024
Step 9: add offline mode

from chatty.

Comments (4)

Karsens avatar Karsens commented on May 15, 2024 2

You could also use Redux Offline.

https://medium.com/@east5th/offline-graphql-queries-with-redux-offline-and-apollo-4837065307f2

from chatty.

srtucker22 avatar srtucker22 commented on May 15, 2024 2

@cybercoder thanks for this! realm is definitely cool -- truly impressive software.

My intention with this tutorial was to introduce basic concepts around how to write GraphQL and React Native code. The step-by-step piece here is to give people an understanding of how each piece fits with the others before it because I've found that many tutorials just show one or two concepts, but not how it all fits together. I've had quite a few people ask me if this code is production ready, and that's really just not what I was attempting here. I chose WhatsApp for the tutorial example because it has a lot of feature requirements that hit on core concepts here -- subscriptions, auth, pagination, different screen types, etc.

If the project were to make a bona-fide messenger app, by all means I would look to use something like realm, but this project is really about teaching the basics of React Native and GraphQL. However, I think it would be great to direct devs to check out tech like realm somewhere in the tutorial. People sometimes construe the tutorial to be a prescriptive guide to making a real-time messaging app, and it would be good to clarify that there's already great infrastructure out there that will take you 90% of the way there out of the box.

As for Steps 9+, I wrote a bunch of code back in the day (with push notifications, etc.) but found it incredibly difficult to maintain this project with just 8 steps, so I've tabled the rest.

from chatty.

cybercoder avatar cybercoder commented on May 15, 2024

Actually, It is better to use realm and it's event listener on objects. A global subscription for message receiving messages and insert it in realm storage. Here is some challenges
One of them is how we can determine which message object we should upgrade it's sent flag after mutation response to show delivery check mark. I hate to use a client side uuid as sending message identifier. hmmm
You can see my attempt to implement it: https://github.com/cybercoder/3cho

from chatty.

cybercoder avatar cybercoder commented on May 15, 2024

Yes, I know, and This is great tutorial and nice with no doubt. My point is there is too many challenges on production ready messenger app. I made some researches and i found WhatsAPP is using XMPP protocol for messaging. The main and key point is http is not a good choice for a production ready messaging app. So i'm looking for apollo clients which using MQTTor XMPPbut there's no choices. Another Solution i found is ``òpenFire```which using xmpp and there is a js client for that, but it is out of graphql.

Warm Regards.

from chatty.

Related Issues (20)

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.