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.
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.
How do I get the AGSOfflineMapSyncTask.checkForUpdates to recognize that there are updated for the map area?
Hi. Thanks for the question. Here's what I think is happening.
Scheduled updates are pre-packaged downloads of changes that are created on the server at an interval determined by the web map's owner (perhaps once a day, at 6am, in preparation for mobile users to start their day with all the updates from the previous 24 hours). So, if you make changes to the web map, there will only be scheduled updates available for download after the next scheduled packaging (in the above example, this would be after 6am). In your case, I'm guessing that the next scheduled packaging hasn't happened yet, so Runtime won't see an update when you call checkForUpdates (remember, that just checks for packaged up scheduled updates).
The scheduled updates enhancement to preplanned maps was created to help large mobile workforces efficiently keep their offline maps up to date, but scheduled updates only provide a read-only offline map experience. This page covers scheduled updates in more detail.
If you want to immediately pick up changes made in the preplanned web map, you will need to modify your code to not opt in to the scheduled update workflow and just do a regular sync.
Hope that helps.
I'm not sure why this was marked as a solution. The information was helpful but it did not solve the issue. I do not get any updates no matter what the time interval is set to so no solution have been discovered. I also removed the scheduled update enhancement but still no updates are downloaded.
Thank you for your reply, this is helpful! I did try several tests where I set the update time to a future date/time and then tried to sync the map after that future time but still got the same "none" reply when calling checkForUpdates.
1) Is there a minimum time interval for the updates? For example if I make changes to the map area in AGOL and then set the update time to several hours in the future, should that trigger an update or is there a 24 hour minimum?
2) Would changing the map area's bounds (reshape the area) trigger an update or will only changes to data trigger an update for sync?
3) The Esri example in "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app assumes the mapview has the map loaded and accessible. Is there an example or best practice for syncing multiple preplanned maps when they are not in use, potentially as a background task?
Glad that helped. For your other questions:
Hope that helps.
In your reply - "You don't set a time in the ArcGIS Online interface" - Can you clarify this. There is a setting for Time in AGOL, can you explain what this time is for?
Apologies. I misunderstood your question about changing the update time to trigger a scheduled updates packaging. My mistake (your question was pretty clear!). I'll have to check with the team to see if this would trigger packaging things up, or if there might be some other way (e.g. a REST call).
I still have not been able to get the preplanned map area sync to work. I have tried removing the scheduled updates and just run a manual update but it never seems to download the updates. Any ideas on what the issue could be?
How is the sample "canyonlands" map setup in "ApplyScheduledUpdatesToPreplannedMapAreaViewController" in the arcgis-ios-sdk-samples app? The example seems to work but if I replace the canyonlands map with one of my maps, it never detects an update as being available.
Thanks for you assistance!