Native code and libraries in Expo · mid
Expo libraries: secure store, SQLite, notifications and background tasks
For data and messaging, Expo apps use expo-secure-store for small secrets (Keychain/Keystore), expo-sqlite for local databases (async and sync APIs, transactions, a kv-store, SQLCipher), expo-notifications for local and push notifications, and expo-background-task for deferred background work.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- expo-secure-store: Keychain on iOS, Keystore-encrypted SharedPreferences on Android; keychainAccessible defaults to WHEN_UNLOCKED; requireAuthentication for biometric-protected items; sync getItem/setItem exist. Data is removed on Android uninstall but may survive on iOS. Keep values small (older iOS rejected values over about 2 KB).
- expo-sqlite: openDatabaseAsync / openDatabaseSync; runAsync, getFirstAsync, getAllAsync, getEachAsync, prepareAsync. execAsync does no escaping, so never pass user input to it. withTransactionAsync vs withExclusiveTransactionAsync. SQLiteProvider + useSQLiteContext; expo-sqlite/kv-store has the AsyncStorage API; SQLCipher with useSQLCipher; works with Drizzle.
- expo-notifications: on Android 13+ create a notification channel before asking for the token, or no prompt appears. getExpoPushTokenAsync({ projectId }) vs getDevicePushTokenAsync (raw FCM/APNs). setNotificationHandler returns shouldShowBanner / shouldShowList / shouldPlaySound / shouldSetBadge; SDK 58 shows foreground notifications by default.
- Notification listeners: addNotificationReceivedListener, addNotificationResponseReceivedListener, useLastNotificationResponse (for taps from a killed state). Background data messages via registerTaskAsync. Remote push needs a development build.
- notifee was archived in April 2026 and points to expo-notifications, which also works in bare apps.
- expo-background-task: WorkManager / BGTaskScheduler; minimumInterval at least 15 min on Android (default 12 h); define the task at module scope; not on the iOS simulator; stops if the user kills the app; test with triggerTaskWorkerForTestingAsync().
The red pen
Common traps: mistake → fix
Mistake: "db.execAsync(
DELETE FROM notes WHERE id = ${id})"Fix: SQL injection risk; use runAsync with parameters.
Mistake: "Store a big JSON cache in secure store"
Fix: keep it for small secrets only.
Mistake: "Request notification permission before creating a channel on Android 13+"
Fix: the prompt does not appear.
Easy to hard
Questions interviewers ask, easy to hard
- Where do you keep the refresh token in an Expo app, and what are its lifetime quirks?
- Design an offline orders table with expo-sqlite: transactions and migrations.
- Expo push token vs device push token: when do you use each?
- Background sync with expo-background-task: what can you promise product?
Practise
Practise with these questions
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.