Select to view content in your preferred language

Unable to Sync PrePlanned Map Area

2106
12
08-18-2021 05:54 PM
RTC
by
New Contributor II

Following the example "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app, I am having an issue syncing a map. I can download the initial map area and us it without any issues.

The problem:

I try to sync the offline map by using AGSOfflineMapSyncTask and calling the checkForUpdates. No matter what changes are made to the map area in AGOL, the checkForUpdates function returns 'none' It does not recognize that there are updates.

Question:

How do I get the AGSOfflineMapSyncTask.checkForUpdates to recognize that there are updated for the map area?

0 Kudos
12 Replies
Nicholas-Furness
Esri Regular Contributor

Hi.

I've spoken with the team and 24 hours is the minimum interval between updates being packaged up. Changing the packaging time will not trigger another packaging within 24 hours of the last packaging.

As for why a manual sync doesn't get the updates: what are the updates you are making? You need to update feature data in layers in your web map (and of course the services behind those layers need to be enabled for offline use).

Once you've made feature updates in the web map (add/remove/update features) then they will be picked up in an offline map sync.

If you are using scheduled updates for the sync, they won't be picked up until after the next packaging run. If you are not using scheduled updates, they should be picked up immediately.

The canyonlands sample uses an already-downloaded preplanned offline map as its "snapshot" starting point. It copies it into a working folder and opens it. The web map has scheduled packages that were generated after that offline map was downloaded, so they show up as available updates in the sample. Once you have applied the updates to the copy in the working folder, if you were to check again using that working copy, there would be no more updates available. The working copy is overwritten by the "snapshot" copy each time you run the sample.

For your map you need to:

  1. Create a web map with offline-enabled feature layers.
  2. Configure the preplanned map area for your web map and turn on the "Enable scheduled updates" toggle.
  3. Wait for the original preplanned offline map to package up.
  4. Download the preplanned offline map to the device, being sure to opt in to scheduled updates (this should be picked up by default).
  5. Make edits to offline enabled feature data in your web map.
  6. Wait until after the next packaging, which will pick up your web map data edits as a scheduled update package. You cannot bring the packaging time forward for this to force packaging any sooner than 24 hours after step 3.
  7. Call sync using the offline map downloaded in step 4 (and making sure to use scheduled updates).

You can still use a web map that is set up for scheduled updates with regular sync, but you have to ensure the settings when you download the offline map opt out of scheduled updates. Perhaps that's what you're seeing: maybe you downloaded the offline map without opting out of scheduled updates, and then when you sync you're trying a regular sync. That won't work (and I think I misled you there - I wasn't explicit that you need to do this with the download as well as the later sync). You could look at the AGSOfflineMapSyncResult you get back in the sync completion to see if there are errors and look at the errors on each layer to learn more.

Let me know if that helps.

0 Kudos
RTC
by
New Contributor II
Hello Nicholas,

Thanks for the detailed response! I will follow your guidelines and do
some more research. I believe my past tests did follow the same
workflow you outlined but now knowing about the 24 hour limit may produce
different results. I will let you know what I find out.

Thanks!
0 Kudos
RTC
by
New Contributor II

Hello Nicholas,

 
I was hoping to get some clarification on a few items. Based on your advice, I ran a few more tests and wanted to confirm that what I am seeing is correct. All my tests are for read-only (download) updates from AGOL, not bi-directional sync.
 
  1. If the "Enable Scheduled Updates" toggle is enabled (true), updates will package and only be made available at the next scheduled time (24 hours later) even if the map is updated manually by using the "Update" button.
  2. If the "Enable Scheduled Updates" toggle is NOT enabled (false), updates will package automatically at the next scheduled time (24 hours later) BUT if the map is updated manually by using the "Update" button, the updates will be available immediately.
  3. If the Update Scheduled TIME is changed AFTER the preplanned map is initially downloaded, the "checkForUpdate" function will return an indeterminate state. To correct this, the preplanned map needs to be downloaded, not synced, again.
  4. ONLY changes to the data of a feature layer are synced, NOT changes to the map region, adding layers, map style (icons) etc. Is there documentation that details what will/won't trigger an update?
 
Thanks!
0 Kudos