PHAsset unique identifier across devices.

I know that I can uniquely identify a PHAsset on a given device using localIdentifier but if that asset is synched (through iCloud, say) to another device, how to I uniquely identify that asset across multiple devices?

My app allows users to store their images in the standard photo gallery, but I have no way of referring to them when they sync their app profile to another iOS device with my app installed.

Have you tried looking at PHCloudIdentifier? It allows you to identify an asset synced via iCloud.

https://developer.apple.com/documentation/photokit/phcloudidentifier

PHCloudIdentifier is meant for this exact use case. Check out the documentation and WWDC talk from 2021:

https://developer.apple.com/documentation/photokit/phcloudidentifier

https://developer.apple.com/wwdc21/10046

PHAsset unique identifier across devices.
 
 
Q