> For the complete documentation index, see [llms.txt](https://lionstudios.gitbook.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lionstudios.gitbook.io/readme/features/remote-storage/use-cases.md).

# Use Cases

Common save-data scenarios and how Remote Storage handles them, plus the API to use for each.

#### Restore after reinstall

The player deletes the game and installs it again. On the first launch, Remote Storage signs into the same device account and pulls the cloud save before `IsDataReady` turns `true`. Keep your loading screen up until `IsDataReady` is `true` and the player continues right where they left off.

#### Show a save-restored popup

Whenever cloud data replaces local data (reinstall restore, sign-in on a new device), `OnRemoteDataUpdated` fires on the main thread. Use it for two things: re-read any values your game keeps in memory, and show the player a popup that their progress was restored from the cloud.

```csharp
RemoteStorage.OnRemoteDataUpdated += ReloadSaveData;
// e.g. re-read saved values and show a save-restored popup
```

#### Continue on a new device

The player signs in with Facebook on the new device. Remote Storage merges that account's save with the device's save, keeps the winner everywhere, and fires `OnRemoteDataUpdated` if the cloud save won.

#### Conflicting progress on two devices

When local and cloud saves differ, the winner is decided by `MergeConflictData`: most recent purchase first, then higher `PlayerXP`, then newest save time. Keep it updated through `Save(MergeConflictData)` — especially right after a purchase.

#### Delete progress

`RemoteStorage.DeleteAll()` clears local data, deletes the cloud save, and removes the account, so the next session starts completely fresh.

#### Playing offline

Reads and writes always work — they are local and instant. `Save()` returns `false` while offline; the data stays safe on the device and reaches the cloud on a later `Save()` or the next session's startup sync. If the connection comes back mid-session, the next `Save()` recovers on its own — it authenticates, pulls and merges the cloud save, then pushes your data. Use `OnSyncStateChanged` to show an offline indicator if you want one.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://lionstudios.gitbook.io/readme/features/remote-storage/use-cases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
