Results 1 to 2 of 2

Thread: [iOS] Empty map (mismatch between version of offline maps and metafiles)

  1. #1
    Etablierter skobbler
    Join Date
    11.02.2015
    Posts
    82

    [iOS] Empty map (mismatch between version of offline maps and metafiles)

    My app is on 3.0.2. Since the map update of 20161212 some of my users have been reporting an empty map when SDK connectivity set to offline (no roads, texts, etc. just a grey screen). I've been able to find the cause and thought I'd share and perhaps that someone knows a nice workaround?

    It's a mismatch between the map version of the offline map packages and the version of the metafiles on the device.

    It seems when the map version is updated (SKMapsService.sharedInstance().mapsVersioningMana ger.update), the new metafiles are not downloaded. If user downloads an offline map in the same app session (so maps will have new version) (without restarting the app) and SDK connectivity mode is offline, the offline maps show empty, since only the old version metafiles are on the device. It's only until a user restarts the app, the metafiles for the new map version are downloaded. After that everything works fine.

    So, is there a way to manually initiate a metafile download after the map version is updated? As far as I know, currently, the only way metafiles are being downloaded is upon SDK initialisation.

    Or, is this is bug in the framework and are you going to include a metafile download in the SKMapsService.sharedInstance().mapsVersioningManag er.update
    method?

  2. #2
    Etablierter skobbler
    Join Date
    11.02.2015
    Posts
    82
    Hi Adrian,

    It's really difficult to reproduce, but I think I owe you an apology. As I was trying to reproduce it, I found that a map update does not cause the 'empty map', but another situation does, which explains why it only sometimes happens and it's difficult to reproduce:

    My app does not ship with any metadata in the bundle, so it relies on the metadata that is downloaded on first launch and then stored in the /Library/Caches folder. Turns out that this folder can be purged by iOS on certain non-specified occasions. For sure this folder is not stored in the iOS Device backup. For more info see this SO thread.

    I've had more users with this problem, but the user I was able to pinpoint the problem with just got a new phone and restored it from a backup. I.e. since the metafiles are in the Library/Caches folder and that folder is not included in the backup, the user did not have the metafiles on the device. After that user restarted my app the metafiles were downloaded and put in the Library/Caches folder once more, and from then on it worked.

    For the other users that reported this I can only guess what happened. Perhaps they also restored their phone from backup, or perhaps iOS purged the Library/Caches folder for another reason (perhaps low on disk space... don't know).

    For my upcoming app update I did 2 things now:
    1. I included the latest metafiles in the app bundle
    2. I check if the metafiles are on the device when the map is first shown. If not I ask the user to relaunch the app:
    Code:
    if SKMapsService.sharedInstance().mapsVersioningManager.metaDataDownloadedStatus != .Downloaded {
    	// show alert asking user to restart the app
    }
    I hope this explains and my apologies for the wrong conclusion I took .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •