Educado-App / educado-mobile

The repository for the educado mobile education application
GNU General Public License v3.0
1 stars 3 forks source link

[OFFLINE] Added Network Status Service #196

Closed ITPini closed 11 months ago

ITPini commented 11 months ago

Description

This update introduces a new method for checking internet connectivity on the client side using the react-native-community/netinfo library. This approach is significantly faster than the previous method, which relied on HTTP polling to the backend. By using the observer design pattern, we can now monitor internet connectivity in real time without server-side dependence.

Changes

Related Issues

None.

Checklist

Screenshots (if applicable)

If mobile/frontend pull request, what version of the backend is it stable, and running on?

Branch: dev

Notes for Reviewers

As in prior versions, to simulate offline mode was done by closing the backend. Going into offline mode can now be done by going in airplane mode or disconnecting from wifi or mobile data. In order to debug in offline mode, set #simulateOffline to true inside NetworkStatusService.js, that way you won't lose connection to Expo