Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[How to use] Asset unique identifier os icloud #1020

Open
StigUK opened this issue Nov 7, 2023 · 3 comments
Open

[How to use] Asset unique identifier os icloud #1020

StigUK opened this issue Nov 7, 2023 · 3 comments

Comments

@StigUK
Copy link

StigUK commented Nov 7, 2023

Platforms

iOS

Description

I have two iOS devices that have the same iCloud and the same gallery.
We use the "id" field in AssetEntity as a unique identifier for the image.
However, if I do AssetEntity.fromId(1) on one device and AssetEntity.fromId(1) on another, will I get the same image?
As I understand it, the id field is local for each device (localIdentifier), so I will receive different images using the same identifier.

Is there any way to get the same image on different devices but with the same gallery?

This is important for my application because I need to remember which images the user has already used, and if he wants to transfer the data to a new device, then I will have problems with this.

My code

No response

Try do it

I see that iOS has a cloudIdentifier. Is it possible to somehow get it using PhotoManager via AssetEntity?
https://developer.apple.com/documentation/photokit/phcloudidentifier

@CaiJingLong
Copy link
Member

If there is this field, it should be exposed to the user, but I also need to find some document of it in Apple website.

@CaiJingLong
Copy link
Member

https://developer.apple.com/documentation/photokit/phphotolibrary/3750728-cloudidentifiermappingsforlocali?language=objc
image

I'll try to add new method to export it future.
But it only support macOS 12+ and iOS 15+.

@StigUK
Copy link
Author

StigUK commented Nov 7, 2023

@CaiJingLong Thank You

@CaiJingLong CaiJingLong changed the title [How to use] Asset unique identifier [How to use] Asset unique identifier os icloud Nov 9, 2023
@CaiJingLong CaiJingLong added this to the 3.1 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants