---
title: "What is the use of authorizationStatus in ALAssetsLibrary?"  
description: "What is the use of authorizationStatus in ALAssetsLibrary?"  
author: "Tarun Kumar"  
published: 2015-12-17  
updated: 2020-09-22  
canonical: https://www.mindstick.com/interview/22946/what-is-the-use-of-authorizationstatus-in-alassetslibrary  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 2 minutes  

---

# What is the use of authorizationStatus in ALAssetsLibrary?

authorizationStatus is a contant of ALAssetsLibrary, it will checks whether the user of application has provided access to the application to access the Assets or not. In case not then it shows up a alert to the end user to enable manually via Settings. One thing to remember there is no way you can change the settings through your app programatically. So this has to be done manually as its upto end user to allow access to Assets for the particular application.\
Its example is here:

```
if([ALAssetsLibrary authorizationStatus]) {  //Library Access code goes here}else {  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Permission Denied" message:@"Please allow the application to access your photo and videos in settings panel of your device" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];  [alertView show];}
```

## Answers

### Answer by Tarun Kumar

authorizationStatus is a contant of ALAssetsLibrary, it will checks whether the user of application has provided access to the application to access the Assets or not. In case not then it shows up a alert to the end user to enable manually via Settings. One thing to remember there is no way you can change the settings through your app programatically. So this has to be done manually as its upto end user to allow access to Assets for the particular application.\
Its example is here:

```
if([ALAssetsLibrary authorizationStatus]) {  //Library Access code goes here}else {  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Permission Denied" message:@"Please allow the application to access your photo and videos in settings panel of your device" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];  [alertView show];}
```


---

Original Source: https://www.mindstick.com/interview/22946/what-is-the-use-of-authorizationstatus-in-alassetslibrary

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
