---
title: BGTaskScheduler.Error.Code.notPermitted
framework: backgroundtasks
role: symbol
role_heading: Case
path: backgroundtasks/bgtaskscheduler/error/code/notpermitted
---

# BGTaskScheduler.Error.Code.notPermitted

A task scheduling error that indicates the app isn’t permitted to launch the task.

## Declaration

```swift
case notPermitted
```

## Discussion

Discussion There are two causes for this error: The app didn’t set the appropriate mode in the UIBackgroundModes array. The task identifier of the submitted task wasn’t in the BGTaskSchedulerPermittedIdentifiers array in The Info.plist File.

## See Also

### Identifying an error

- [BGTaskScheduler.Error.Code.tooManyPendingTaskRequests](backgroundtasks/bgtaskscheduler/error/code/toomanypendingtaskrequests.md)
- [BGTaskScheduler.Error.Code.unavailable](backgroundtasks/bgtaskscheduler/error/code/unavailable.md)
- [BGTaskScheduler.Error.Code.immediateRunIneligible](backgroundtasks/bgtaskscheduler/error/code/immediaterunineligible.md)
