---
title: "Announcing Mobile Offline Support"
description: "Announcing Mobile Offline Support"
published: "2015-05-29"
last_updated: "2015-05-29"
authors:
  - "Jonny Dimond (Core Developer)"
categories:
  - "Realtime Database"
  - "Android"
  - "iOS"
canonical_url: "https://firebase.blog/posts/2015/05/announcing-mobile-offline-support_93"
---

# Announcing Mobile Offline Support

*Published May 29, 2015 by Jonny Dimond (Core Developer)*

---
Have you ever had an app suddenly stop working when you lost your internet connection? Or perhaps you've opened an app you were using just minutes prior, only to find you have to re-download all of your data?

As a developer, you've likely tried to solve these pain points in your own apps, only to find the work required to be daunting. Wouldn't it be great if your database could just handle this for you automatically?

### Firebase Offline to the Rescue
Today we're announcing a set of features for our [iOS](/docs/ios/guide/offline-capabilities.html) and [Android](/docs/android/guide/offline-capabilities.html) SDKs that will allow you to build apps that work smoothly offline!

Our new SDKs support persisting your synchronized data to disk, so it's available immediately when your app starts. You can enable disk persistence with one line of code:

```js
Firebase.getDefaultConfig().setPersistenceEnabled(true);
```

```js
[Firebase defaultConfig].persistenceEnabled = YES;
```

```js
Firebase.defaultConfig().persistenceEnabled = true
```

Our new SDKs now also let you specify data to be prefetched and kept up to date so that it will be available offline later if you need it. This `keepSynced` feature can be enabled on a per-path basis with one line of code:

```js
ref.keepSynced(true);
```

```js
[ref keepSynced:YES];
```

```js
ref.keepSynced(true)
```

### Built from the Beginning for Offline
The Firebase database uses synchronization rather than request / response to move data between client and server. All read and write operations happen against a local, on-device version of your database first. Then, data is pushed and pulled from our servers behind the scenes. This design has allowed the Firebase database to compensate for network latency -- local write operations are reflected by local reads before being acknowledged by the server.

It turns out, though, that this design is also essential to a high quality offline experience. By sending all reads and writes through a local version of the database, the Firebase SDK maintains the freedom to serve that data from the best source available -- whether that’s from the network or local disk. Later, when a network connection becomes available, our SDK automatically commits local operations to the server and pulls in the latest remote updates.

![Offline gif](https://firebasestorage.googleapis.com/v0/b/first-class-blog.appspot.com/o/blog-assets%2F2015%2F05%2Fannouncing-mobile-offline-support_93%2Foptimized%2Foffline.gif?alt=media)

We designed Firebase for offline support from the very beginning, and we've been working on it for years. [Citrix](https://www.citrix.com/) has been beta testing our offline support for its iOS app [Talkboard](https://www.citrix.com/products/talkboard/overview.html) since 2013. When you draw on a canvas in Talkboard, any updates you make while offline will be saved to disk and synchronized later when you reopen the app.

### Getting Started
We've been working on these features for a long time, and we couldn't be more excited to see what you build with them! Getting started is easy -- just check out the offline section of our guides for [iOS](/docs/ios/guide/offline-capabilities.html) or [Android](/docs/android/guide/offline-capabilities.html). We also have offline drawing examples for [iOS](https://github.com/firebase/ios-drawing) and [Android](https://github.com/firebase/AndroidDrawing) that can help you get started quickly.

As you're coding, we'd love to hear what you think! Please share your feedback in our [Google Group](https://groups.google.com/forum/#!forum/firebase-talk) or mention [@Firebase](https://twitter.com/firebase) on Twitter.
