It’s not a question of legality but rather a question of Privacy.
In order for your App to access the users photo library, you need to add a key:value pair into your Info.plist
. The key name is Privacy - Photo Library Usage Description
and the value needs to be a statement as to why the App needs access to the photo library.