Expo Adapter
Notes on Android
Section titled “Notes on Android”- By default, Android requires
https(including WebSocket connections) when communicating with a sync backend.
To allow for http / ws, you can run expo install expo-build-properties and add the following to your app.json (see here for more information):
{ "expo": { "plugins": [ "expo-build-properties", { "android": { "usesCleartextTraffic": true }, "ios": {} } ] }}Resetting local persistence
Section titled “Resetting local persistence”When iterating locally you can ask the Expo adapter to drop the on-device state and eventlog databases before booting:
import { makePersistedAdapter } from '@livestore/adapter-expo'
const resetPersistence = process.env.EXPO_PUBLIC_LIVESTORE_RESET === 'true'
const adapter = makePersistedAdapter({ storage: { subDirectory: 'dev' }, resetPersistence,})