React Native: The dark side of Background tasks
summary
Concrete examples and code decisions matter: demos include a working music player built with a native media player (Android service / ExoPlayer option) that keeps playing after the app is killed, and a 24‑hour sync implemented with a custom sync adapter on Android plus headless JS to spin up the JS bridge. iOS uses background fetch with its hard limits (≈15‑minute scheduling, ≈30‑second runtime). code is open source and the approaches are tested, not hypothetical.
AI-written summary · about
chapters (29)
- 0:00React Native: The Dark Side of Background Tasks Ferran Negre
- 2:36Why this talk?
- 5:48App elements
- 6:01React UI
- 6:17almost all npm packages you love
- 6:33React Native A wrapper for native code ...with a bridge!
- 6:58Android Services, Broadcast receivers, Content providers
- 7:30iOS Background modes, Touch ID, Face ID...
- 8:08Your app in the background
- 8:33Android vs iOS It's different!
- 9:14The Android way Services
- 10:50The iOS way iOS background modes
- 11:58Playing music
- 12:16react-native-track-player
- 13:27await TrackPlayer.setupPlayer(); catch (e) // Error
- 17:37react-native-spotify-streamer
- 17:53Sync data
- 18:35Android Headless JS
- 18:47Headless JS Service
- 20:44When to start it?
- 21:28Network connectivity
- 21:55react-native-sync-adapter
- 23:40React Native and Native Modules: The Android SyncAdapter
- 25:00IOS Headless JS No such concept
- 27:21Broadcast Receivers On Android
- 28:27Wake up recap!
- 29:54There is no magic
- 30:16We are mobile developers
- 30:59Thank you! @ferranno
related talks
17mBreaking the Limits of React Native with Multithreading
45mThe Dark Art of Native APIs
28mOffline first applications in React Native done well
42mReact Native case study: From zero to a super hero app
38mBuilding a Video Player from Scratch with React Native
28mAsynchronous & Offline Magic Tricks on React Native
25mReact Native in Practice
28mReact Native Architecture Overview
