Returning to app after using makeWebRequest using Sync - over Wi-Fi using the 3.1 Toybox.Communications.SyncDelegate.

Hi, I'm using direct connection to wifi to get data from a web service (without being connected to a mobile phone). All works really well and I can start sync, gather data and display it on my device, but I don't quite follow what happens when I send notifySyncComplete and how to correctly resume my widget app.

The limited info available says - 'The Sync UI will be popped off the stack returning you to your app'.

However I get left on the sync complete view and I'm not sure what state my app (widget in this case) is in. 

Are there examples or instructions on the correct flow here ? Any help appreciated. Cheers.

Connect IQ 3.1 Connects You to The World - News & Announcements - Connect IQ - Garmin Forums

In Connect IQ 3.1 device apps now can initiate network requests over Wi-Fi using the new Toybox.Communications.SyncDelegate. Here’s how:

  1. In your app, call Toybox.Communications.startSync
  2. The system will call getSyncDelegate() to get your Toybox.Communications.SyncDelegate subclass
  3. The device UI will go to a sync screen
  4. In onStartSync make your first call to Toybox.Communications.makeWebRequest
  5. Request one item at a time, triggering each makeWebRequest in the callback of the previous one
  6. Call notifySyncProgress to advance the progress bar
  7. If onStopSync is called, handle shutdown of your sync
  8. When you have downloaded all items, call notifySyncComplete. Pass in null if you completed successfully or pass in a string if you need to display an error message
  9. The Sync UI will be popped off the stack returning you to your app