iosios-simulatoralassetslibrarygeotagging

Is it possible to access a photo's geotag metadata from within the simulator?


I've written an app that retrieves a photo's GPS metadata, and it works on my iPhone but doesn't in the simulator. If I drag a photo containing geotags onto the simulator, it gets placed into the photo library. Then, my app issues this code:

ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation];
NSDictionary *metadata = [assetRepresentation metadata];

and metadata contains all sorts of items, but not GPS. Is there some trick to getting the simulator to recognize GPS metadata?

Alternatively, what I'm trying to do is run the app in the simulator as many different devices to get screenshots for the App Store. How do you prepare App Store screenshots if your app won't work properly in the simulator?


Solution

  • To answer my own question, it appears that GPS metadata is removed from photos when you copy them to the simulator via drag and drop. Once I followed @soulshined's suggestion below (put the photo onto Dropbox and downloaded it from within the simulator) then everything worked perfectly.