0

In my app I have a Settings section which should be able to handle the app-privacy the same as the iOS settings does (using on/off switches).

I know how to gain authorization for photo library but is there a way to change the permission to .denied manually?

Here is my Authorizing code:

let status = PHPhotoLibrary.authorizationStatus()
if( status != .authorized ){
    PHPhotoLibrary.requestAuthorization { status in
        switch status {
        case .authorized:
            switchButton.setImage(UIImage(named: "SwitchOn"), for: .normal) // Change the button image for Switch On
            break
        case .denied, .restricted: break
            // 
        case .notDetermined: break
            // 
        }
    }
}
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Lahiru Pinto
  • 1,621
  • 19
  • 20
  • 2
    In iOS/watchOS, .. there is no way to change permission manually. All the permission must be acquired from user, and changed from setting menu. You can let user go to the app setting page though. – Ryan May 01 '19 at 18:52
  • Why would you want to do this? You should be happy that user allows some privacy settings because you need it for some purpose, dont you? – Robert Dresler May 01 '19 at 18:55
  • @RobertDresler I know what u mean :D. Im trying to implement clients requirement here :( . User should be able to enable and disable permissions inside the App same as the settings. – Lahiru Pinto May 01 '19 at 19:20
  • 2
    @LahiruPinto clients are sometimes crazy... tell him that this isn't possible and if he wouldn't trust you, give me his phone nubmer... – Robert Dresler May 01 '19 at 19:21
  • @RobertDresler LoL I have suggested to open the IOS App Settings from there :D – Lahiru Pinto May 02 '19 at 07:04

0 Answers0