---
title: "contentKeySession(_:shouldRetry:reason:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcontentkeysessiondelegate/contentkeysession(_:shouldretry:reason:)"
---

# contentKeySession(_:shouldRetry:reason:)

Provides the receiver with a content key request object to retry.

## Declaration

```swift
optional func contentKeySession(_ session: AVContentKeySession, shouldRetry keyRequest: AVContentKeyRequest, reason retryReason: AVContentKeyRequest.RetryReason) -> Bool
```

## Parameters

- `session`: The content key session that is providing the content key request.
- `keyRequest`: The key request to be retried.
- `retryReason`: The reason for the retry request.

## See Also

### Updating and retrying content key requests

- [contentKeySession(_:didProvide:forInitializationData:)](avfoundation/avcontentkeysessiondelegate/contentkeysession(_:didprovide:forinitializationdata:).md)
- [contentKeySession(_:externalProtectionStatusDidChangeFor:)](avfoundation/avcontentkeysessiondelegate/contentkeysession(_:externalprotectionstatusdidchangefor:).md)
- [contentKeySession(_:didUpdatePersistableContentKey:forContentKeyIdentifier:)](avfoundation/avcontentkeysessiondelegate/contentkeysession(_:didupdatepersistablecontentkey:forcontentkeyidentifier:).md)
- [AVContentKeyRequest.RetryReason](avfoundation/avcontentkeyrequest/retryreason.md)
- [contentKeySessionContentProtectionSessionIdentifierDidChange(_:)](avfoundation/avcontentkeysessiondelegate/contentkeysessioncontentprotectionsessionidentifierdidchange(_:).md)
- [contentKeySession(_:contentKeyRequest:didFailWithError:)](avfoundation/avcontentkeysessiondelegate/contentkeysession(_:contentkeyrequest:didfailwitherror:).md)
- [contentKeySession(_:contentKeyRequestDidSucceed:)](avfoundation/avcontentkeysessiondelegate/contentkeysession(_:contentkeyrequestdidsucceed:).md)
- [contentKeySessionDidGenerateExpiredSessionReport(_:)](avfoundation/avcontentkeysessiondelegate/contentkeysessiondidgenerateexpiredsessionreport(_:).md)
