Skip to main content

Rollup

static let String
The SDK’s version, such as "0.1.0".
@MainActor static func
Registers the background processing task that keeps the index up to date (<bundle ID>.rollup.update). Call it before your app finishes launching, as iOS requires. It does nothing if your Info.plist does not permit that identifier.
@MainActor static func throws
Sets up the SDK with your app’s publishable key and what to index. Calling it again changes the options; the index follows them.Throws simulatorUnsupported in the Simulator, notConfigured for a key that does not start with rk_, and missingRequirement naming each missing Info.plist entry. It cannot check for the App Attest capability: a missing capability shows when the device first registers, as appAttestFailed.
@MainActor static let RollupClient
The client for every other call.
static var JSONEncoder
Encodes SDK results with ISO 8601 dates and sorted keys.
static var JSONDecoder
Decodes SDK results with ISO 8601 dates.

RollupClient

Use it through Rollup.shared. Every method except requestPhotoAccess throws notConfigured before configure, and accessRevoked while your app’s access is stopped. search, query and profile throw photoAccessDenied while Photos access is denied or restricted.
Indexing
Indexing’s state and control. See Indexing.
async -> PhotoAccess
Shows iOS’s Photos prompt, once. If the person grants access, the first index starts at once and continues in the background. Returns the person’s answer, including denied and restricted; it does not throw.
Searches the index on the iPhone: dates, places, media, and what photos show or say. Most relevant first. Throws noIndex when nothing is indexed yet. See Search.
async throws -> Answer
Answers a question about the person’s life from the index. The model runs on Rollup’s server; its tools run on the iPhone, and only their text results leave it. See Query.
async throws -> Profile
Fills a JSON Schema about the person from the index: the schema’s shape exactly, null where their life does not say, with the photos behind each filled field. Takes the schema as JSON Data or as a JSONValue. See Profile.
async throws
Deletes everything the SDK keeps: the index, downloaded models and place data, queued run reports, the device credential, and the device’s record on Rollup’s server. Indexing starts again from scratch when next started.

Indexing

Use it through Rollup.shared.indexing.
IndexingState
Where indexing is now. See IndexingState.
AsyncStream<IndexingState>
The current state, then every change after it.
func
Starts indexing now, or brings the index up to date, and lets it continue in the background with the system progress UI. Call it from a person’s action, such as a tap. A run that is already under way gains background continuation.
IndexOptions
What to index. Setting it changes the index in place on the next run, which starts shortly. See Index options.

PhotoAccess

The person’s answer to the Photos prompt. With limited, the SDK indexes only the photos the person selected.