Is it possible to access a photo's geotag meta

2019-03-01 02:42发布

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?

1条回答
不美不萌又怎样
2楼-- · 2019-03-01 03:32

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.

查看更多
登录 后发表回答