selectsProfileAutomatically

fun selectsProfileAutomatically(selectsProfileAutomatically: Boolean): SdkConfig.Builder

Lets the SDK choose the active profile, for a host that has no profiles of its own.

Defaults to false: the host owns the choice and makes it through CgsAuth.selectProfile, and nothing is active until it does.

Set it to true and the SDK adopts the first profile the account holds whenever the session has none — at authenticate, at refreshProfiles, and on the first use of CGS.auth, CGS.content or CGS.reader after a relaunch. It never creates a profile: it adopts one the backend already returned, so an account that holds none stays at account scope and reads perfectly well.

A profile already active is left alone — a refresh returns the same profile for a profile-less account, and moving a reader would re-key its downloads and reading progress. The one exception is a profile the account stops listing: it is dropped as always, and the first of the remaining ones is adopted in its place.

While this is on, CgsAuth.selectProfile is rejected with CgsError.UnsupportedOperation — the choice is the SDK's, and two owners of it would only fight.

Return

this builder.

Parameters

selectsProfileAutomatically

true to let the SDK adopt a profile, false to keep the choice.