Platform Support
Background syncing has been tested in:- Flutter - Using workmanager
- Kotlin Multiplatform - Android - Implementation details in the Supabase To-Do List demo
Flutter Implementation Guide
Prerequisites
- Complete the workmanager platform setup
- Review the Supabase To-Do List Demo for context
Configure the Background Task
Inmain.dart
:
- Since WorkManager executes in a new process, you need to set up the PowerSync local database and connect to the remote database using your connector.
- Run a write (in the case of this demo app, we create a ‘todo list’)
- Make sure to run
currentConnector.uploadData(db);
so that the local write is uploaded to the remote database.
Testing
Add a test button:Platform Compatibility
Android
- Implementation works as expected.