πŸ“± App Development Study/iOS🍎

iOS Limited Photos Permission(iOS 14 이상)

ibelieveinme 2024. 4. 9. 20:41
728x90

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

 

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()
    }
}

*참고둜 iOS PHAutorizationStatus 값은 int 둜 λ°˜ν™˜ν•˜λŠ”λ°, μœ„μ™€ 같이 0 ~ 4둜 λ‚΄λ €μ˜¨λ‹€.

 


 

iOS 14 이상 λΆ€ν„° μ„ νƒν•œ μ‚¬μ§„λ§Œ μ ‘κ·Ό κ°€λŠ₯ν•œ κΆŒν•œμ΄ μΆ”κ°€λ˜μ—ˆλ‹€. limited !

 

UnityNativeGallery κΉƒν—ˆλΈŒ μ˜€ν”ˆμ†ŒμŠ€μ— PHAuthorizationStatusLimited κΆŒν•œμ— λŒ€ν•œ λ‚΄μš©μ΄ λͺ…μ‹œλ˜μ–΄ μžˆμ§€ μ•Šμ•˜λ‹€.

즉 limited κΆŒν•œμ„ μ£Όλ©΄ κΆŒν•œμ„ λ‹€μ‹œ μš”μ²­ν•˜κ±°λ‚˜ κΆŒν•œμ΄ μžˆλ‹€κ³  νŒλ‹¨ν•˜λŠ” μ½”λ“œκ°€ μ ν˜€μžˆμ§€ μ•Šμ•˜λ‹€.

 

μ΄μŠˆκ°€ λ°œμƒν•œ 앱은 μ„ νƒν•œ μ‚¬μ§„λ§Œ μ ‘κ·Ό κ°€λŠ₯으둜 체크해도 앱이 λ™μž‘ κ°€λŠ₯ν•œ μ•±μ΄μ—ˆλ‹€.

ios 가러리 κΆŒν•œ 체크 μ‹œ limited κΆŒν•œμ— λŒ€ν•œ μ˜ˆμ™Έμ²˜λ¦¬λ₯Ό μΆ”κ°€ν•˜κ³  limited κΆŒν•œμ΄λΌλ„ 있으면 ν•΄λ‹Ή μ•±μ—μ„œ μ‚¬μ§„κΆŒν•œμ„ λ‹€μ‹œ 물어보지 μ•Šκ³  정상 μ§„ν–‰ν•˜κ²Œ ν–ˆλ‹€.

728x90