ios9 - PHPhotoLibrary requestAuthorization, not requesting -


first time app run (and time), system popup showed, requesting access. not show again.

here's code:

[phphotolibrary requestauthorization:^(phauthorizationstatus status) {      switch (status) {         case phauthorizationstatusauthorized:             nslog(@"phauthorizationstatusauthorized");             break;          case phauthorizationstatusdenied:             nslog(@"phauthorizationstatusdenied");             break;         case phauthorizationstatusnotdetermined:             nslog(@"phauthorizationstatusnotdetermined");             break;         case phauthorizationstatusrestricted:             nslog(@"phauthorizationstatusrestricted");             break;     }  }]; 

keeps printing "phauthorizationstatusdenied". not present popup. returns immediately.

it suggested add 'bundle display name' plist. tried no avail, empty value, $(product_name), , different strings.

cleaned project, deleted driveddata (and delete app simulator every time). no luck.

more info:

the apple sample code "samplephotosapp", crashing once turn off photo access in settings.

after further reading, seems design.

from apple:

this method returns immediately. if user has previously granted or denied photo library access permission, executes handler block when called; otherwise, displays alert , executes block after user has responded alert.

saying 'this method returns immediately' if user prompt once. after not show request again. seems no way (but custom message) use system message again.


Comments