authorization for media library dose not run the handler

72 Views Asked by At
    MPMediaLibrary.requestAuthorization { (status) in
       if status == MPMediaLibraryAuthorizationStatus.authorized  {
          print("Accepted")
       } else {
          print("not authorized")
       }
    }

The code above worked fine until 12.3.1 update of iOS. But now the closure is not calling at all. Have anybody encountered this yet or I am missing something?

1

There are 1 best solutions below

4
mohamed khiari On
    MPMediaLibrary.requestAuthorization { (status) in
        if status == .authorized {
            print("Accepted")
        } else {
            print("not authorized")
        }
    }