3

It's not asking permissions for gallery in iOS 9 but in iOS 8 it works fine. Maybe I need any permission key in info.plist?

 PHPhotoLibrary.requestAuthorization({ (status) -> Void in

 })
Cœur
  • 37,241
  • 25
  • 195
  • 267
Artem Kislitsyn
  • 395
  • 1
  • 3
  • 18

2 Answers2

5

This issue appear in iOS 9 when your application Info.plist file contains a key: "CFBundleDisplayName" with empty string value.

You can enter your app name there and it should work.

key {Bundle display name} value $(PRODUCT_NAME)

same problem founded there and solution App does not have access to your photos or videos iOS 9

Community
  • 1
  • 1
Artem Kislitsyn
  • 395
  • 1
  • 3
  • 18
0

You do not need a key in your info.plist. First be sure:

  • Import the Photos.framework via Link Binary With Libraries
  • Import Photos into your View Controller

        let status = PHPhotoLibrary.authorizationStatus()
    
        if status == .Authorized {            
            //  Permission Authorized       
        } else if status == .Restricted {            
            //  Permission Restricted
        } else if status == .NotDetermined {        
            //  Permission Not Determined
        } else if status == .Denied {        
            //  Permission Denied
        }
    
Jeremy H
  • 452
  • 7
  • 20