Provides methods to requesting Photo Library permissions
It would be required if your app wants to access camera or photo library.
Will trigger only in
install event. Does not have webview actions yet.
Promise.resolve(Bool) if the permission is granted.
$photolibrary.granted().then(granted => alert(granted));
$photolibrary.authorize(showAlert = false)
Promise.resolve(Int) with the Authorization Status.
showAlert = true then it will prompt an alert requesting the user go Settings.
The returned number corresponds to
PHAuthorizationStatusNotDetermined = 0 User has not yet made a choice with regards to this application
PHAuthorizationStatusRestricted = 1
This application is not authorized to access photo data. The user cannot change this application’s status, possibly due to active restrictions such as parental controls being in place.
- PHAuthorizationStatusDenied = 2
User has explicitly denied this application access to photos data.
- PHAuthorizationStatusAuthorized = 3
User has authorized this application to access photos data.
- PHAuthorizationStatusLimited = 4
User has authorized this application for limited photo library access. Add PHPhotoLibraryPreventAutomaticLimitedAccessAlert = YES to the application's Info.plist to prevent the automatic alert to update the users limited library selection.
$photolibrary.authorize().then(status => $logger.trace(status));
Add NSPhotoLibraryUsageDescription and NSCameraUsageDescription permissions to info.plist
<key>NSPhotoLibraryUsageDescription</key> <string>If you want to use the photolibrary, you have to give permission.</string> <key>NSCameraUsageDescription</key> <string>If you want to use the camera, you have to give permission.</string>