简体   繁体   English

"PHAsset(或 ALAsset)跨设备标识符"

[英]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.我实际上正在创建一个 iOS 应用程序,并希望将有关照片库图片的一些详细信息存储在 SQLite 数据库中。 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).我还希望能够在用户拥有的不同设备上共享这些数据(想象有人想在他的 iPhone 上重新组织图片,并想在他的 iPad 中检索相同的订单)。

I have searched across the Apple documentation, but did not find any PHAsset<\/code> identifier that is shared across devices.我搜索了 Apple 文档,但没有找到任何跨设备共享的PHAsset<\/code>标识符。 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.我还尝试检查 PHAsset 的PHImageFileURLKey<\/code> 、 hashValue<\/code>或localIdentifier<\/code> PHAsset<\/code>共享,但它们都不是。

Has someone already done something like this?有人已经做过这样的事情了吗?

"

There is none at the moment. 目前没有。 PHAsset had a shared identifier in the first iOS 8 Betas, but it was removed later on. PHAsset在第一个iOS 8 Betas中有一个共享标识符,但后来被删除了。

It looks like, that for all PHAssets that have been synced with iTunes, the localIdentifier is identical, even across devices. 看起来,对于已与iTunes同步的所有PHAsset,localIdentifier都是相同的,即使是跨设备也是如此。 Means: if you import images from one device and sync them to another device, the localIdentifier of the PHAsset is identical. 意思是:如果从一个设备导入图像并将它们同步到另一个设备,则PHAsset的localIdentifier是相同的。

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

"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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