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

Add getAlbumsPath() #78

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Add getAlbumsPath() #78

merged 1 commit into from
Dec 20, 2023

Conversation

nkalupahana
Copy link
Collaborator

@nkalupahana nkalupahana commented Dec 20, 2023

Fixes #77 and #74

  • Code Review
  • Android
  • iOS

@nkalupahana nkalupahana merged commit 98fff2d into master Dec 20, 2023
@nkalupahana nkalupahana deleted the getAlbumsPath branch December 24, 2023 23:12
@mfschieber
Copy link

Hey !
I'd like to use this function to check the path of my album in order to know if the user has access to it or not. For example, if a user creates a "RANDOM" album from his library and i only have access to the albums from my app, i will not be able to store them in "RANDOM" album.

i see in this pr that it has been developed for both ios & android but in the documentation it's apparently for android only - can i use it for ios as well or not ?

apparently i can also have two albums with the same name on IOS :
Screenshot 2024-01-02 at 11 31 35

Thank you for your help 🙏

@nkalupahana
Copy link
Collaborator Author

@mfschieber iOS albums work very differently compared to Android albums. In iOS, albums can't "belong" to apps -- they're all created within the iOS Photos system. Because of this, an app can't have access to only "its" albums, because that doesn't exist. It either has access to all albums or no albums. (You can see this with the example app: the example app can save images to any albums, provided it has unlimited photo library access. However, if its photo library access is limited, it can't write to any albums.)

Additionally, unlike in Android where we interface with the filesystem directly to make albums, there is no filesystem access for photo albums on iOS (again, everything is managed via iOS Photos). That's why getAlbumsPath() is Android only, as it says in the documentation -- there is no filesystem path for albums on iOS like there is on Android. (The checkbox in the PR is to indicate the latest build has been tested on iOS, not that the added feature exists.)

And yes, multiple albums can in fact have the same name on iOS. It should be unlikely to have name conflicts on albums, and if you're worried about name conflicts, the easiest thing to do would be to choose a more unique name. You could also probably store the album identifiers for the albums you've created in-app, but I really think choosing a more unique name is the way to go. I'm also not sure if Apple guarantees that album identifiers will never change when iOS is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RuntimeException occurred / EACCES (Permission denied) when trying to save a photo/gif/video on android < 13
2 participants