PHAsset (or ALAsset) cross-device identifier

偶尔善良 提交于 2020-01-13 10:24:10

问题


I am actually creating an iOS app, and want to store some details about Photo Library pictures in an SQLite database. I also would like to be able to share this data across the different devices the user has (imagine someone wanted to reorganize pictures on his iPhone, and wants to retrieve the same order in his iPad).

I have searched across the Apple documentation, but did not find any PHAsset identifier that is shared across devices. I also tried to check if the PHImageFileURLKey, hashValue, or localIdentifier of the PHAsset where shared, but none of them are.

Has someone already done something like this?


回答1:


There is none at the moment. PHAsset had a shared identifier in the first iOS 8 Betas, but it was removed later on.




回答2:


It looks like, that for all PHAssets that have been synced with iTunes, the localIdentifier is identical, even across devices. Means: if you import images from one device and sync them to another device, the localIdentifier of the PHAsset is identical.



来源:https://stackoverflow.com/questions/28690304/phasset-or-alasset-cross-device-identifier

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!