Docs / iOS (preview)

iOS Coming soon · preview

The iOS SDK is in development. This page shows the planned integration so you can plan ahead. The API may change before release.

iOS SDK in development. Contact us for early access. Nothing on this page is available yet. It is a design preview of the planned integration; names and signatures may change before the first release. Ask about early access.

The iOS SDK is planned to share the Android SDK’s beauty pipeline, presets, parameter ranges and licences. Licences already accept iOS bundle IDs, so a licence issued today can list both your Android package and your iOS bundle ID.

Planned installation

Both Swift Package Manager and CocoaPods are planned.

// Package.swift (planned)
dependencies: [
    .package(url: "<Facevity iOS package URL>", from: "0.1.0")
]
# Podfile (planned)
pod 'Facevity'

Planned setup with a licence

import Facevity   // planned module name

let fv = try Facevity.initialize(options: .init(licenseServerURL: URL(string: "https://<licence server>")!))
fv.activateLicense(key: "FV-XXXX-XXXX-XXXX-XXXX") { info in
    print("Facevity licence:", info.status)
}
fv.setParams(.natural)          // .natural, .glam, .default, .none
fv.setSmoothIntensity(55)

As on Android, an offline licence file bundled with the app and a token from your own backend are planned alternatives.

Planned frame processing (CVPixelBuffer)

The iOS SDK is designed around CVPixelBuffer, which is what AVFoundation and most RTC SDKs deliver.

// Planned: processes the pixel buffer in place (BGRA or NV12) and returns true if it changed it.
let changed = fv.process(pixelBuffer, orientation: .up, mirrored: false, timestamp: time)

Planned AVFoundation integration

extension CameraController: AVCaptureVideoDataOutputSampleBufferDelegate {
    func captureOutput(_ output: AVCaptureOutput,
                       didOutput sampleBuffer: CMSampleBuffer,
                       from connection: AVCaptureConnection) {
        guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else { return }
        let time = CMSampleBufferGetPresentationTimeStamp(sampleBuffer)
        fv.process(pixelBuffer, orientation: .up, mirrored: false, timestamp: time)   // planned API
        // Hand the (processed) sample buffer to your preview, encoder or RTC SDK as before.
    }
}

Planned RTC hooks

The same rule as on Android applies: process the outgoing frame before the encoder, so remote participants receive the beautified video.

  • Agora: a raw video frame observer on the capture position, processing the frame’s CVPixelBuffer in place.
  • WebRTC / LiveKit: a capturer delegate that processes the RTCCVPixelBuffer before forwarding the frame to the video source.
  • ZEGOCLOUD: custom video processing with a CVPixelBuffer buffer type.

Get early access

If iOS matters for your launch, tell us your timeline and the RTC SDK you use. Early-access partners help us prioritise the integrations above.

Need help with an integration? Contact the Facevity team. We answer integration questions during trials.