iOS (Official) Photos app can display some EXIF-related metadata (e.g. camera and lens info, ISO, shutter speed, F-number) even when photos are offloaded to iCloud and the device is not connected to internet (e.g. airplane mode).
However, with the Photos.framework, we need to download photos to retrive those metadata (which means it will not work with airplane mode).
I tried the following methods, but none of those worked when photos were offloaded to iCloud and the device was in airplane mode:
- Requesting data with
PHImageManager.default().requestImageDataAndOrientation
- Result: It does not return Data if the photo is not stored locally on the device, even with
options.deliveryMode = .fastFormat
- Result: It does not return Data if the photo is not stored locally on the device, even with
- Converting
PHAsset#localIdentifier
to an AssetsLibrary.framework URL (assets-library://asset/...
)- (I am aware that AssetsLibrary.framework is deprecated, but this was just a test.)
- Result: If PHImageManager does not returns Data,
ALAsset#defaultRepresentation().metadata()
returns an empty NSDictionary