선택한 사진 권한 (Android/ iOS)
각 iOS 14, Android도 14 이상부터 개인정보 관련으로 갤러리 내부의 사진을 이용할 때 앱에서 접근할 수 있는 사진을 제한할 수 있도록 권한을 부여할 수 있다.
iOS
Delivering an Enhanced Privacy Experience in Your Photos App | Apple Developer Documentation
Adopt the latest privacy enhancements to deliver advanced user-privacy controls.
developer.apple.com
// Request read-write access to the user's photo library.
PHPhotoLibrary.requestAuthorization(for: .readWrite) { status in
switch status {
case .notDetermined:
// The user hasn't determined this app's access.
case .restricted:
// The system restricted this app's access.
case .denied:
// The user explicitly denied this app's access.
case .authorized:
// The user authorized this app to access Photos data.
case .limited:
// The user authorized this app for limited Photos access.
@unknown default:
fatalError()
}
}
각 케이스는 주석에 써져있는 내용 그대로이다.
보통 QA 단에서는 not determined 상태에서 사진을 선택 하려고 할 때 시스템의 권한 요청 출력되는지,
denied 일 때, 권한을 요구한다는 안내 팝업이나 적절한 조치가 되어있는지, 등을 확인할 것이다.
Android
https://developer.android.com/about/versions/14/changes/partial-photo-video-access?hl=ko
사진 및 동영상에 대한 일부 액세스 권한 부여 | Android 개발자 | Android Developers
Android 14 베타에 오신 것을 환영합니다. Android 14를 최고의 버전으로 만들 수 있도록 의견을 제공해 주세요. 사진 및 동영상에 대한 일부 액세스 권한 부여 컬렉션을 사용해 정리하기 내 환경설정
developer.android.com
https://android-developers.googleblog.com/2023/08/choosing-right-storage-experience.html
Choosing the right storage experience
Now you can offer visual media selection in your mobile application with the privacy-preserving changes we've made across multiple Android releases.
android-developers.googleblog.com
iOS와 마찬가지로 갤러리에서 해당 앱에서 접근할 수 있는 미디어를 선택할 수 있다.
권한 관련 테스트를 하다보니 저렇게하면 사진의 exif 데이터를 접근하기 어려운 이슈가 발생되어서 이것저것 뒤져보고 있다.
점점 권한 체계가 ios를 따라가는 듯..