I’m working with FairPlay offline licenses using AVContentKeySession and ran into behavior that I cannot find documented.
I am explicitly calling:
contentKeySession.processContentKeyRequest(
withIdentifier: identifier as NSString,
initializationData: nil,
options: nil
)
Expected behavior
I expect that each call to processContentKeyRequest will eventually result in the delegate callback: contentKeySession(_:didProvide:)
Observed behavior
If I call processContentKeyRequest with a new identifier, everything works as expected:
- didProvide is called
- I complete the request successfully
However, if I call processContentKeyRequest again with the same identifier that was already processed earlier, then:
- No delegate callbacks are triggered at all
- The session does not appear to be blocked or stuck
- If I issue another request with a different identifier, it is processed normally
So the behavior looks like the session is silently ignoring repeated requests for the same content key identifier.
Important context
- This is not a concurrency issue — the session continues processing other requests
- This is reproducible consistently
- I am not using renewExpiringResponseData(for:) because I do not have a live AVContentKeyRequest at the time of retry
Use case
My use case is offline playback with periodically refreshed licenses. The app can stay alive for a long time (days/weeks), and I need to proactively refresh licenses before expiration.
In this scenario:
- I only have the contentKeyIdentifier
- I do not have a current AVContentKeyRequest
- Calling processContentKeyRequest again for the same identifier does not trigger any delegate callbacks
Questions
- Is this behavior expected — that AVContentKeySession ignores repeated processContentKeyRequest calls for the same identifier?
- What is the recommended way to re-fetch or refresh a license when:
- I only have the identifier
- I do not have a current AVContentKeyRequest
- I need to refresh proactively (not just in response to playback)
-
What is the intended approach in this case? Maybe to create a new AVContentKeySession to force a new request cycle? Or something else?
-
Is there any way to guarantee that a call to processContentKeyRequest will result in a delegate callback, or is it expected that it may be ignored in some cases?
Any clarification on the intended lifecycle of AVContentKeySession and how repeated requests should be handled would be greatly appreciated.