Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step 9: add offline mode #13

Open
srtucker22 opened this issue Aug 17, 2017 · 4 comments
Open

Step 9: add offline mode #13

srtucker22 opened this issue Aug 17, 2017 · 4 comments

Comments

@srtucker22
Copy link
Owner

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

@Karsens
Copy link

Karsens commented Aug 21, 2017

You could also use Redux Offline.

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

@cybercoder
Copy link

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

@srtucker22
Copy link
Owner Author

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

@cybercoder
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants