简体   繁体   中英

PHAsset (or ALAsset) cross-device identifier

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 also tried to check if the PHImageFileURLKey<\/code> , hashValue<\/code> , or localIdentifier<\/code> of the PHAsset<\/code> where shared, but none of them are.

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

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.

更新:从 iOS 15 开始,所有设备都可以使用一个标识符: https<\/a> :\/\/developer.apple.com\/documentation\/photokit\/phcloudidentifier

"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM