# Offline Mode

Offline mode allows to use app when there is no Internet connection.&#x20;

#### WHAT CAN BE DONE IN OFFLINE MODE ON MOBSTED PLATFORM

Mobsted PWA Offline mode allows to:

* Access the app

{% hint style="info" %}
User will not be able to access the app if[ access restrictions](../../../references/intro-placeholder/user_access#manage-mobsted-pwa-app-user-access) are set in the app and user has never been authorized.
{% endhint %}

* View all the static data i.e. text, images, icons
* Navigate between the screens
* Work with cached Dynamic data
* Submit data:
  * for iOS it will be delivered the next time the user accesses the app online
  * for Android and other systems, the data will be sent when Internet connection appears, even if the app is closed.

#### DIFFERENCES IN OFFLINE MODE: MOBSTED VS REGULAR PWA

Mobsted platform provides own Offline mode features:

* **Service Workers** **work properly with browsers**: behavioral logic of app is stored on device and works in error-free mode
* **Outgoing data calls queue**: server calls are queued on device and will be sent out once app is back online
* **3** **offline performance levels**:
  * cache
  * local storage
  * [background sync](https://developers.google.com/web/updates/2015/12/background-sync).

#### HOW MOBSTED OFFLINE MODE WORKS

Platform supports Offline Mode without any interference from app user or administrator.

How that works on the technical side:

1. **Service Workers** if Chrome is used and **AppCache** in case of Safari allow an app to have permanent access to:
   1. HTML code
   2. CSS styles
   3. JavaScripts
   4. Icons & images
   5. Fonts
2. Inbound API requests Caching: app saves received data in indexedDB
3. Outbound API requests Caching: done by using Service Worker (if supported by the browser) and indexedDB, i.e.-

* Caching using Service Worker allows to exchange data between PWA app and the server when app is closed and Internet connection is present.
* Requests saved to indexedDB will be sent to the server when app is opened and Internet connection is present.

Cache and indexedDB usually take about 5-15 MB of the storage on user device (much less than native apps).

#### HOW TO CHECK OFFLINE MODE

1. Create app with a couple of screen switch actions
2. Open app on device
3. Check that it works properly
4. Set your device to Airplane mode
5. Check the app working the same way it was when online.

![](https://storage.googleapis.com/helpdocs-assets/jyme83anlw/articles/eu3o6up76s/1564637931408/ezgif-com-video-to-gif-1.gif)

#### MENTIONED ARTICLES

* [User Access](https://mobsted-2.gitbook.io/knowledge-base/user_access)
* [Introducing background sync](https://developers.google.com/web/updates/2015/12/background-sync)
