iOS and Android

A native app written in Swift or Kotlin sends to Tailcove with the official OpenTelemetry SDKs, which carry logs and traces, and reports crashes with a Sentry SDK pointed at your source's DSN. Both work today, with no Tailcove SDK to install. Using React Native or Flutter instead? See React Native and Flutter.

3 min read

On this page5 sections

The app key#

An app cannot keep a secret, so it never carries the source's ingest token. It sends an app key, which is public by design: it only works for the app ids you allow (your iOS bundle id and Android package name, such as com.acme.shop, or com.acme.*), and it has a rate limit of its own, so a copied key cannot use up your source's quota. Generate it and list your app ids under Mobile apps in your source's Settings tab.

Every request carries two headers:

X-Tailcove-App-Key: <your app key>
X-Tailcove-App-Id: com.acme.shop

The OpenTelemetry endpoints for logs and traces take these in place of the ingest token:

  • Logs: https://ingest.tailcove.dev/api/v1/otlp/v1/logs
  • Traces: https://ingest.tailcove.dev/api/v1/otlp/v1/traces

Metrics stay on the ingest token: a key shipped inside an app cannot write a source's metrics. Everything else about the endpoints (protobuf or JSON, gzip, limits) is on the OpenTelemetry page.

iOS (Swift)#

Add the opentelemetry-swift package and its OpenTelemetryProtocolExporterHTTP product, then create the exporters with the two headers:

import OpenTelemetryProtocolExporterHttp

let config = OtlpConfiguration(headers: [
    ("X-Tailcove-App-Key", "<your app key>"),
    ("X-Tailcove-App-Id", Bundle.main.bundleIdentifier ?? ""),
])

let logExporter = OtlpHttpLogExporter(
    endpoint: URL(string: "https://ingest.tailcove.dev/api/v1/otlp/v1/logs")!,
    config: config
)
let traceExporter = OtlpHttpTraceExporter(
    endpoint: URL(string: "https://ingest.tailcove.dev/api/v1/otlp/v1/traces")!,
    config: config
)

Register them with a batch processor in your logger and tracer providers, as the OpenTelemetry Swift documentation shows, and set service.name on the resource to your app's name. Network spans from URLSession instrumentation appear on the source's Traces tab.

Android (Kotlin)#

Add io.opentelemetry:opentelemetry-exporter-otlp (or the OpenTelemetry Android agent, which uses the same exporters) and give the exporters the two headers:

val logExporter = OtlpHttpLogRecordExporter.builder()
    .setEndpoint("https://ingest.tailcove.dev/api/v1/otlp/v1/logs")
    .addHeader("X-Tailcove-App-Key", "<your app key>")
    .addHeader("X-Tailcove-App-Id", BuildConfig.APPLICATION_ID)
    .build()

val spanExporter = OtlpHttpSpanExporter.builder()
    .setEndpoint("https://ingest.tailcove.dev/api/v1/otlp/v1/traces")
    .addHeader("X-Tailcove-App-Key", "<your app key>")
    .addHeader("X-Tailcove-App-Id", BuildConfig.APPLICATION_ID)
    .build()

Wire them into an SdkLoggerProvider and SdkTracerProvider with batch processors. The OpenTelemetry Android agent also records app start, screen changes, ANRs and crashes as telemetry through the same exporters.

Crashes#

Install sentry-cocoa (iOS) or sentry-android (Android) and set its DSN to the one under Error tracking in your source's Settings tab. Mobile SDKs send no browser Origin, so no allowed origin is needed. Each crash becomes an error line with the exception and its frames, grouped into an issue with its release and environment. See Sentry SDKs for what Tailcove keeps.

Tailcove does not symbolicate native crashes yet: in a release build a frame shows the function name only when the SDK could resolve it on the device, otherwise an address. Upload of dSYM and ProGuard/R8 mapping files is a later step.

What is planned#

Dedicated Swift and Kotlin SDKs, with the same queue, retries and automatic context as the React Native and Flutter clients, are a later step. Until then, OpenTelemetry and a Sentry SDK cover logs, traces and crashes.

Still stuck?

Email us and we will help you get it working.

Contact support