Synchronization over Wi-Fi
Now that we've surveyed the landscape, Wi-Fi seems to be our best option for offline synchronization. Let's go through the process of setting up an ad hoc network, synchronizing PouchDB over this connection, and then reconciling any conflicts when we go back online.
Setting up the P2P connection
These instructions assume that you have an OS X laptop. The instructions for Windows are similar. On your laptop, do the following:
Click on the Wi-Fi status icon in your status bar:
Click on Create Network….
Name the network
Todo App
and click on Create.Notice how the Wi-Fi status icon has changed:
Now, connect to this network on your iPhone (or other mobile device).
Open Settings.
Choose Wi-Fi.
Select the Todo App network.
Click on Join Anyway.
You've now created a P2P network between your laptop and mobile device. You're also offline. Next, we'll implement support for offline syncing between these devices.