Offline behavior

AppSheet apps can be used on a mobile device even when that device is offline and disconnected from the network. This is possible because the information needed to run the app (the app definition, the data, and optionally images and documents) is stored locally on the mobile device. If you are running the app in a web browser, please read the information at the end of this article.

One important pre-condition for all offline access is that the app must initially be launched on the device when it is online. This allows the needed information to be downloaded and stored locally.

Offline behavior is controlled via the Behavior>Offline & Sync tab. 

Delayed sync: 'Sync' is the step that sends data updates from the device to the backend and retrieves the latest app definition and data from the backend to the device. If you choose Delayed Sync for your app, the app will not sync data immediately when an edit/delete/add occurs. Rather, your changes will be queued up until you explicitly choose to sync. You should select this option for apps that are expected to work in offline environments or where you want to control when sync occurs. For example, you can use Delayed Sync to control when you use network data bandwidth.

Intermittent connectivity: Apps that don't enable Delayed Sync will attempt to synchronize changes every time that data changes on the device. However, even in a connected environment, there may be intermittent connectivity problems that prevent synchronization from succeeding. In this case, AppSheet automatically queues changes and defaults to delayed sync behavior to prevent the loss of data. Even repeated sync retries will not cause duplication or corruption of data, except for the special case where you use RowNumber as your key. Please read this article describing row number keys.

Viewing content offline: All spreadsheet/table data is automatically copied to the device so that it is available offline. However, images and documents are not copied to the device by default, because they may be large. You can enable 'Offline Content Caching' to tell AppSheet to copy images and documents to the device. As with all other offline data caching, the images and documents are copied to the device when the app is initially run on the mobile device while online. The images and documents are refreshed as needed when Sync occurs.

Depending on the number and size of your images and documents, it may take several minutes for all of your content to be downloaded and saved on the device. Even if the images or documents are displayed by the client, this does not mean that the content has been downloaded and saved. When you first download the content, you should connect your device to the network, launch the application, and wait for a few minutes before disconnecting. Then go offline and check whether all of the images and documents have been downloaded and saved on the device. If not, reconnect and allow even more time for the images and documents to be downloaded and saved.

Note that offline content viewing of images and documents only works when the links to the images or documents use relative paths as described in this article.

Launching offline: If you have used the lightweight deployment mechanism, you are familiar with launching apps from their homescreen icons. By default, a mobile device needs to be online in order to launch an app from its homescreen icon. Once launched, the app can then function offline or with intermittent connectivity.

However, if you wish to launch the app when the device is offline, you must go to the Behavior>Offline & Sync tab and set the 'Offline App Launch' option. You must do this before installing the app on your device. If your app has already been installed to the homescreen, the shortcut must be deleted and installed again after enabling the offline option. Otherwise you will need to launch it from the AppSheet app itself.

Prolonged offline use: You should not run for prolonged periods (multiple days or weeks) while completely offline and without connectivity. There are two reasons for this:

  1. The app creator may make modifications to the app definition, and the user's app falls out of date.
  2. There may be changes to the underlying data. If the offline app makes its own data changes, an eventual sync will apply these "old" updates at a much later time and override changes made by other users.

Offline with sign in: If your app requires sign in your users will occasionally be asked to sign in again when their authentication expires.  This will only occur during a sync when the device has connectivity.

Running in a offline browser: Some customers choose to run the app in a web browser (fullscreen or in an iframe). This is particularly useful when running on mobile platforms like Windows Phone where the mobile app isn't supported.

The browser must be online when the AppSheet application is first loaded. Once the app is loaded it can be used when the device is offline or has intermittent network connectivity. However, offline image and document caching will not work. You can keep working in this manner offline as long as the page isn't closed / unloaded. Saved changes will persist across page reloads / browser restarts for all data types except images or documents in a form.  For images or documents, sync must be performed before that browser tab is closed-- otherwise, the captured image/document content will be lost.

Have more questions? Submit a request

0 Comments

Article is closed for comments.