SyncFlow is a .NET MAUI application that enables peer-to-peer (P2P) configuration synchronization between devices using Couchbase Lite. It provides a simple and efficient way to share configuration data between devices without requiring a central server.
- 📱 Cross-platform support (iOS and Android)
- 🔄 Real-time P2P configuration synchronization
- 📊 Local and received configuration management
- 🔒 Basic authentication for secure data transfer
- 🎯 Simple and intuitive user interface
- 📦 Automatic demo configuration generation
- .NET SDK: 9.0.200
(Check withdotnet --version) - Java: OpenJDK 21.0.7
(Check withjava -version) - Android Target SDK: 31 (Android 12)
- Android Min SDK: 21 (Android 5.0)
- iOS Min Version: 11.0
- Xcode: 16.3
(Check withxcodebuild -version) - Visual Studio Code (with C# Dev Kit and MAUI extensions) or Visual Studio 2022
- .NET MAUI workload (install via
dotnet workload install maui) - Android SDK (API level 31 or higher)
- Apple Developer account (for deploying to physical iOS devices)
- iOS Simulator (iOS 11.0 or later)
To check your installed versions, use:
dotnet --versionjava -versionxcodebuild -version
- .NET: 8.0+
- Android: API 31+ (Android 12+)
- iOS: 11.0+
- Xcode: 14.0+
- Java: 11+
If you do not have an Apple Developer account, you can still run the app on the iOS Simulator by adding the following property to your .csproj file:
<PropertyGroup>
<EnableCodeSigning>false</EnableCodeSigning>
</PropertyGroup>This disables code signing and allows you to build and run on the iOS Simulator without a developer account. (You cannot deploy to a physical device without an account.)
Note: If you do not have an Apple Developer account, the iOS simulator will not run unless you add the following settings to your
.csprojfile:<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-ios'"> <RuntimeIdentifier>iossimulator-arm64</RuntimeIdentifier> <CodesignKey>Apple Development</CodesignKey> <CodesignTeamId>CKP5JB49M4</CodesignTeamId> <EnableCodeSigning>false</EnableCodeSigning> </PropertyGroup>This disables code signing and allows you to build and run on the iOS Simulator without a developer account. (You cannot deploy to a physical device without an account.)
Before building or running the project, make sure you have the necessary .NET workloads installed:
dotnet workload install maui
dotnet workload install ios
dotnet workload update- Clone the repository:
Follow these steps to build, run, and test the P2P demo between iOS and Android emulators:
-
Navigate to the project directory:
cd MauiP2P/CouchbaseMauiApp -
Clean the build:
dotnet clean
-
Build the Android APK:
dotnet build CouchbaseMauiApp.csproj -f net8.0-android
-
(Required) Update your
.csprojfor Android: In the<PropertyGroup Condition="'$(TargetFramework)' == 'net8.0-android'">section, add:<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
This is required for the Android emulator run command to work.
-
Run the Android emulator and deploy the app:
(emulator -avd Pixel_6_API_34 &); adb wait-for-device; dotnet build CouchbaseMauiApp.csproj -t:Run -f net8.0-android
Replace
Pixel_6_API_34with your actual AVD name if different. -
Build the iOS app:
dotnet build CouchbaseMauiApp.csproj -f net8.0-ios
-
Run the app on the iOS simulator:
dotnet build CouchbaseMauiApp.csproj -t:Run -f net8.0-ios
-
Test the P2P Demo:
- On the iOS simulator, select a configuration file to broadcast and click Start Broadcast.
- Note the broadcasting port displayed (e.g.,
64595). - On the Android emulator, go to the Receive Configuration (P2P Client) section.
- Enter the IP as
10.0.2.2and the port you see on the iOS device. - Click Start Receive.
- You should see the received configuration appear on the Android device.
Tip: Always ensure both emulators are running and networked before starting the demo.
