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

Change the method used in order to detect the device's network connection #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sergioyepes21
Copy link

I think you should consider changing the way you detect the device's internet connection. As I understood reading by your code, the application does not detect when the device has lost network connection until it makes another service call. Then, it starts calling the service every 3 seconds in a loop until the connection is back.
This behavior could affect the performance of the app, as it will constantly be trying to make new network calls until the user has a network connection again. Besides, it is a good practice to notify the user when the device has lost internet connection, instead of only showing a loading page.
Therefore, I recommend you use the connectivity plugin to detect the connection status via a stream. With this new plugin, you should be able to detect when the user has lost/gained an internet connection and update the UI accordingly. Likewise, the app will be able to pause network and service calls until a stable connection returns.
The pull request I made shows how to make use of this plugin, by showing a “No Network Connection” message in the home page whenever the device has lost internet connection
Please take into account that the translation updates did not work for me, nor did I have the chance of testing the code on an iOS device.
Hope this can come in handy to you guys.
Warm regards,
Sergio Yepes

@bbedward
Copy link
Collaborator

That's a good point and we talked about it before but never implemented it.

We made an animation for kalium https://rive.app/a/yekta/files/flare/kalium-no-internet-animation/preview for this specific purpose.

I'll take a look at this pull later this weekend

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

Successfully merging this pull request may close these issues.

2 participants