---
updatedAt: 2026-02-04T10:19:34.000Z
agentTools:
  siteIndex: https://developer.bitmovin.com/llms.txt
  projectIndex: https://developer.bitmovin.com/playback/llms.txt
---

# Playing iStreamPlanet protected content with the iOS Player SDK

```swift Swift
let fpsConfig = FairplayConfiguration(license: drmLicenseUrl, certificateURL: drmCertificateUrl)

fpsConfig.prepareCertificate = { (data: Data) -> Data in
    guard let certString = String(data: data, encoding: .utf8),
          let certResult = Data(base64Encoded: certString.replacingOccurrences(of: "\"", with: "")) else {
        return data
    }
    return certResult
}

fpsConfig.prepareContentId = { (contentId: String) -> String in
    let prepared = contentId.replacingOccurrences(of: "skd://", with: "")
    let components : [String] = prepared.components(separatedBy: "/")
    return components[2]
}

fpsConfig.prepareMessage = { (spcData: Data, assetID: String) -> Data in
    return spcData
}

fpsConfig.prepareLicense = { (ckcData: Data) -> Data in
    guard let ckcString = String(data: ckcData, encoding: .utf8),
        let ckcResult = Data(base64Encoded: ckcString.replacingOccurrences(of: "\"", with: "")) else {
        return ckcData
    }
    return ckcResult
}
```

# Initialize a FairplayConfiguration object

<!-- swift@1 -->

Initialize a FairplayConfiguration object by passing the appropriate license and certificate URLs.

# Provide the required callbacks

<!-- swift@3-27 -->

Set up the 'prepareCertificate', 'prepareContentId', 'prepareMessage' and 'prepareLicense' callbacks.