chatty icon indicating copy to clipboard operation
chatty copied to clipboard

Step 9: add offline mode

Open srtucker22 opened this issue 7 years ago • 4 comments

If we're talking about cache control, makes sense to put this feature here. Could eliminate auth store as well for much cleaner flow 👍

This should really get implemented after #4 is successfully part of the tutorial

srtucker22 avatar Aug 17 '17 18:08 srtucker22

You could also use Redux Offline.

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

Karsens avatar Aug 21 '17 15:08 Karsens

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

cybercoder avatar Oct 17 '19 09:10 cybercoder

@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.

srtucker22 avatar Oct 18 '19 14:10 srtucker22

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.

cybercoder avatar Oct 20 '19 10:10 cybercoder