Skip to main content
Version: 0.4

Configuration

Two options govern the Fedo SDK, both optional, and the defaults fit most apps: a 10-second HTTP timeout and quiet logging. Below: when to change them, and what misconfigured setups look like in your logs.

Configuration is applied once, inside the trailing lambda of Fedo.initialize (the config: argument on iOS), and never varies per screen. For runtime-decided behavior, compute it at startup — from a build flavor or a remote flag — and feed the value into the lambda.

When to change the defaults​

  • Raise the timeout for slow or unreliable networks — flaky mobile data, field-service and ride apps, high-latency regions.
  • Lower it to 3_000–5_000 when your own backend is fast and you want submissions to fail fast rather than hold a spinner.
  • Set a logHandler while integrating, or to diagnose a "feedback did not post" report. On Android, FedoLogHandler.Logcat writes a plain-text trail of what the SDK is doing, tagged Fedo. On either platform, your own handler can forward logs to your logging or error tracking service.

Initialization with a custom configuration​

Pass the config to Fedo.initialize:

Fedo.initialize(
applicationContext,
"your-api-key",
) {
timeoutInMillis = 15_000
logHandler = FedoLogHandler.Logcat
}

The lambda is optional. Call Fedo.initialize(context, "your-api-key") to use the defaults.

Options reference​

PropertyTypeDefaultDescription
timeoutInMillisLong10_000HTTP request timeout for API calls
logHandlerFedoLogHandler?nullReceives every SDK log. null means the SDK logs nothing
debugBooleanfalseDeprecated, use logHandler = FedoLogHandler.Logcat. Removed in 0.5.0

On iOS the options are:

PropertyTypeDefaultDescription
networkTimeoutTimeInterval10Total time limit in seconds for each request, including connecting, sending and receiving
logHandlerFedoLogHandler?nilReceives every SDK log as a FedoLogEntry. nil means the SDK logs nothing
logLevelFedoLogLevel—Deprecated, use logHandler and filter on entry.level. Removed in 0.5.0

logLevel is not a property: it belongs to the older FedoConfig(networkTimeout:logLevel:) initializer, which builds a print-based logHandler for you. That initializer is deprecated since 0.4.0 and will be removed in 0.5.0; use FedoConfig(networkTimeout:logHandler:) instead.

timeoutInMillis​

The per-request timeout for every API call the SDK makes: loading the board, posting, voting, commenting, and identity calls from User Management. When a request exceeds it, the call fails and the SDK surfaces its error state; there is no automatic retry, so the user may need to try again.

logHandler​

Receives every log the SDK emits. Without one, the SDK logs nothing. To see the logs in Logcat, use the built-in handler:

logHandler = if (BuildConfig.DEBUG) FedoLogHandler.Logcat else null

It logs under the Fedo tag, with the stack trace of any exception. Filter with:

adb logcat -s Fedo

To forward logs to your own logging or error tracking service, pass your own handler. It receives every FedoLogLevel (VERBOSE, DEBUG, INFO, WARN, ERROR), so filter in the handler:

logHandler = FedoLogHandler { level, message, throwable ->
if (level >= FedoLogLevel.WARN) myLogger.log("[Fedo] $message", throwable)
}
  • The handler runs synchronously on whichever thread logged, main or background: keep it fast and thread-safe.
  • Don't call Fedo methods from inside it.
  • Exceptions it throws are caught and ignored.
  • Messages never contain the user's email, display name or property values.

The handler only affects logging, not SDK behavior.

On iOS, logHandler is a closure that receives a FedoLogEntry:

FieldTypeDescription
levelFedoLogLevel.debug, .info, .warning or .error
messageStringThe message text
categoryStringSDK area that logged it: core, network, storage or ui
error(any Error)?The underlying error, when the message reports a failure

It receives every level, so filter inside it:

import OSLog

let logger = Logger(subsystem: "com.example.myapp", category: "Fedo")

Fedo.initialize(
apiKey: "your-api-key",
config: FedoConfig(logHandler: { entry in
guard entry.level >= .warning else { return }
logger.error("[Fedo/\(entry.category, privacy: .public)] \(entry.message, privacy: .public)")
})
)
  • The closure may be called from any thread: keep it fast and thread-safe.
  • Don't call Fedo methods from inside it.
  • Messages never contain the user's email, display name or property values.
  • Without a handler the SDK is silent, except for setup mistakes you must fix (a blank API key, a Fedo view shown before initialize). Those are always logged as errors to OSLog under the fedo.sdk subsystem.

debug / logLevel (deprecated)​

On Android, debug is replaced by logHandler = FedoLogHandler.Logcat. debug = true still logs to Logcat when no logHandler is set. On iOS, the FedoConfig(networkTimeout:logLevel:) initializer is replaced by FedoConfig(networkTimeout:logHandler:); it still prints entries at or above logLevel. Both will be removed in 0.5.0.

Calling initialize more than once​

Not allowed. Only the first Fedo.initialize call takes effect; any later call is a no-op, so you cannot change the API key or configuration at runtime. Decide both once, up front.

Blank API key​

initialize logs error if the key is blank — a programmer error, since an invalid key cannot fall back to another board (see Core concepts). The problem is wiring, not a transient condition.

Troubleshooting and FAQ​

My feedback never posts — is it a timeout?​

Possibly — check the logs first. Set logHandler = FedoLogHandler.Logcat, reproduce, and filter adb logcat -s Fedo; you will see each request, its outcome, and any error. If the board loads but a single post fails, a longer timeoutInMillis is unlikely to help — that points at a backend or networking issue. See Getting Started for the other failure modes.

Where are the debug logs? I see nothing in Logcat.​

The SDK logs nothing without a logHandler. Confirm you set logHandler = FedoLogHandler.Logcat in the initialize lambda, rebuilt, and are filtering the right tag — Fedo. On iOS, pass a logHandler closure in FedoConfig; there is no built-in one, so print or forward the entries yourself.

Do I have to configure anything to use Fedo?​

No. Fedo.initialize(context, "your-api-key") with the defaults is all the SDK needs; the UI is self-contained (see Feedback UI).