HomeCase studiesA Headless CMS and Native Kotlin/Swift Mobile...

Case study · Sydney, Australia

A Headless CMS and Native Kotlin/Swift Mobile Publishing Platform for Digital Media

Digital media and publishing — editorial and video content

Wrapping a desktop news site inside a mobile webview leaves readers staring at loading spinners, clipped video embeds, and unreliable breaking-news links. We built native Android and iOS publishing applications using Kotlin (with Retrofit) and Swift (with Alamofire), driven by a JavaScript headless CMS content API and Firebase messaging pipeline. Journalists compose rich stories and video packages once in a structured schema, preview exact native mobile layouts prior to publication, and push breaking alerts that route readers smoothly into cached, adaptive-bitrate stories.

Industry
Digital media and publishing — editorial and video content
Solution
Native Android (Kotlin) and iOS (Swift) editorial and video publishing apps powered by a JavaScript headless CMS API, CDN caching layer, and Firebase notification pipeline.
Platforms
Android · iOS · Web & API
Stack
JavaScript · Kotlin · Swift · Firebase · Retrofit · Alamofire
Location
Sydney, Australia · delivered remotely
Role
Engineering, with the team behind for mobile and QA

Delivered remotely for a business based in Sydney, Australia. Names withheld by agreement.

Project Overview

Readers expect news and video apps to open instantly on a morning train, transition seamlessly from headline alerts into full stories, and play video bulletins without stuttering. When a digital publisher relies on embedded HTML webviews inside a thin mobile shell, every editorial tweak risks layout breakage, third-party scripts block rendering, and breaking-news traffic spikes easily overwhelm backend CMS servers.

We engineered a native mobile publishing platform consisting of Kotlin (Android) and Swift (iOS) applications backed by a JavaScript headless CMS API, adaptive HLS video delivery, and Firebase push orchestration. Editorial teams author articles and video packages once as typed content blocks, preview drafts directly inside native mobile views, and distribute breaking alerts that land readers straight inside fast, edge-cached stories.

Business Bottleneck

The publisher's earlier mobile distribution pipeline suffered from three recurring constraints:

  • Brittle HTML parsing in webviews: Arbitrary markup copied from web CMS editors introduced broken image aspect ratios, orphaned video embeds, and sluggish scroll behaviour on mobile handsets.
  • Thundering-herd push outages: Every major breaking-news alert sent thousands of readers tapping notifications within seconds, slamming origin CMS databases with uncached article fetches.
  • Fragmented video and editorial workflows: Video clips lived on separate player pages detached from written reporting, forcing awkward in-app browser redirects that caused readers to abandon sessions.

Architectural Strategy

Instead of shipping presentation HTML over the wire, we redesigned the JavaScript headless CMS layer to emit a strict, versioned JSON block schema—representing headlines, body paragraphs, pull quotes, image carousels, inline video players, and related-story cards cleanly. On Android, Retrofit deserializes these blocks into native Jetpack/RecyclerView components; on iOS, Alamofire maps the exact schema into Swift native views.

To shield the JavaScript origin from breaking-news surges, every published feed and story endpoint sits behind a CDN configured with surrogate-key cache invalidation. Publishing or updating an article fires a webhook that purges only the affected story and section keys, leaving the rest of the catalog warm at the edge.

Core Capabilities

  • Native Block-Based Article Reader: Structured JSON blocks render crisp typography, dynamic dark mode, swipeable photo galleries, and inline attribution cards without webview overhead.
  • Adaptive HLS Video & Audio Playback: Built-in ExoPlayer (Android) and AVPlayer (iOS) integrations stream multi-bitrate video bulletins with background audio continuity and picture-in-picture support.
  • Topic-Driven Breaking Alerts: Readers subscribe selectively to editorial beats managed through Firebase Cloud Messaging, tapping notifications that deep-link straight to the target story or live video stream.
  • Saved Offline Reading Queue: Subscribers bookmark long-form features for underground commutes; local persistence retains story JSON and compressed hero imagery for offline access.
  • Pre-Publish Mobile Draft Preview: Journalists generate signed preview links from the JavaScript CMS to inspect typography, captions, and video thumbnails on real Android and iOS devices prior to publishing.

Technical Architecture

Both mobile clients isolate networking behind clean repository facades so UI screens never parse raw CMS quirks directly. On Android, Retrofit with OkHttp interceptors injects conditional cache headers and handles transient socket retries; on iOS, Alamofire RequestInterceptor pipelines mirror those exact authentication, preview-token, and retry policies.

Flow: Editor publishes structured story in JavaScript CMS -> Webhook purges CDN surrogate keys & triggers Firebase Cloud Messaging topic push -> Reader taps alert -> App Link / Universal Link opens native screen -> Retrofit / Alamofire fetches edge-cached JSON blocks & HLS manifest -> Native Kotlin/Swift UI and video player render story.

When a breaking story receives rapid live-blog updates, lightweight polling or notification-triggered refreshes fetch compact delta blocks by revision ID rather than reloading unchanged media assets.

Technology Stack

Category Technology detail
Android client Kotlin with native RecyclerView/Compose structured article renderers
Android networking Retrofit with OkHttp disk cache, interceptors, and retry backoff
iOS client Swift with native article block views and smooth gesture navigation
iOS networking Alamofire Session manager with request adapters and response caching
Headless CMS & API JavaScript (Node.js) structured content API and webhook publisher
Push & analytics Firebase Cloud Messaging topic subscriptions and Firebase Analytics events
Video delivery Adaptive bitrate HLS streams played via native ExoPlayer and AVPlayer
Edge caching CDN caching with surrogate-key invalidation on editorial publish
Deep linking Universal Links and Android App Links linking push, web, and native screens
Offline reading Local article JSON and hero-image persistence for saved stories
Editorial preview Signed draft-token API mode rendering unpublished stories on test devices

Engineering Trade-offs & Solutions

Architectural Dilemma Chosen Solution & Rationale
Embedded HTML webviews vs. JSON block native rendering Adopted a typed JSON block schema rendered natively in Kotlin and Swift, trading upfront component work for fluid scrolling, dark-mode fidelity, and predictable inline video playback.
Direct origin API reads vs. CDN surrogate-key caching Placed an edge cache in front of the JavaScript CMS API with publish-triggered purges, ensuring breaking-news push spikes hit edge nodes instead of backend databases.
Custom media player vs. native ExoPlayer / AVPlayer Integrated platform-standard HLS players via Kotlin and Swift abstractions to inherit OS picture-in-picture, lock-screen controls, and adaptive bitrate switching reliably.
Static push topics vs. CMS-driven channel registry Served notification categories from the headless API so editorial desks can launch temporary event feeds without shipping mobile app updates.

Security & Reliability

Draft articles and embargoed investigations must never leak onto public CDN edges. Preview requests require short-lived cryptographic tokens validated in the JavaScript API and carry Cache-Control: private, no-store headers so intermediary caches never retain unpublished copy.

Push notification dispatch endpoints verify editorial role permissions and enforce duplicate-send guards so an accidental double-click in the CMS dashboard cannot broadcast duplicate breaking alerts to readers. On the client side, graceful block fallbacks ensure that if the editorial team introduces an experimental embed type ahead of an older app release, Retrofit and Alamofire skip or link-card the unknown block cleanly rather than crashing the article view.

Performance & Scale

News feeds load paginated, lightweight summary cards first while deferring full article payloads and high-resolution galleries until selection or smart pre-fetch triggers. Both OkHttp and Alamofire disk caches serve stale-while-revalidate snapshots immediately on cold launch, presenting yesterday's cached front page within milliseconds while refreshing headlines quietly in the background.

Video thumbnails and article hero imagery request width-tailored variants from an image-resizing CDN matching the handset's pixel density, avoiding wasted cellular megabytes while keeping visual sharpness intact across tablets and phones.

Operational Outcomes

Transitioning from webview shells to a headless JavaScript API powering native Kotlin and Swift readers unified the editorial and video experience under one responsive interface. Newsroom staff gained confidence through exact mobile draft previews, push-notification surges stabilized behind edge caching, and mobile readers received reliable offline access and adaptive video playback tuned for daily commuting conditions.

01 — Questions

asked about this kind of project

Why replace mobile webviews with native block renderers fed by a JavaScript headless CMS?

Raw HTML articles packed with ad scripts and iframe embeds break native scroll physics, inflate battery drain, and look inconsistent across screen densities. Delivering structured JSON content blocks lets Kotlin and Swift render headings, pull quotes, galleries, and native video players at hardware refresh rates.

How do Retrofit and Alamofire prevent origin overload when a breaking-news push triggers thousands of simultaneous opens?

Breaking-news notifications include canonical story identifiers cached aggressively at the CDN edge with surrogate keys and stale-while-revalidate directives. Both Retrofit's OkHttp cache and Alamofire's URLCache honor conditional ETag validation, absorbing thundering-herd spikes at the edge rather than hitting the Node.js CMS origin.

How do journalists verify how an article or video embed will appear on phones before hitting publish?

The JavaScript CMS generates a short-lived signed preview token tied to a draft revision. Editors scan a QR code or tap a deep link on a staging build of the Kotlin or Swift app, passing the token via Retrofit or Alamofire headers to inspect the exact native layout before live release.

How does the video player handle readers switching between cellular and Wi-Fi mid-bulletin?

Videos are transcoded into segmented HLS playlists with multiple bitrate rungs. Native ExoPlayer on Android and AVPlayer on iOS step stream quality up or down automatically based on measured bandwidth while preserving playback position across screen rotation and picture-in-picture mode.

How are Firebase topic subscriptions kept tidy as editorial sections evolve?

Available notification channels—such as breaking news, sport, or regional bulletins—are fetched dynamically from the CMS configuration endpoint rather than hardcoded in mobile binaries. Users toggle topics in-app, keeping Firebase Cloud Messaging subscriptions synchronized with active editorial desks.

03 — Similar project?

describe what is different about yours

Build yours.

Tell me what exists, what you need and the deadline. Fixed price for a defined scope, or $55/day (8–9 hours work) with a written plan first.

Solitaire Corporate Park, Makarba, Ahmedabad, Gujarat 380015, India · IST (UTC+5:30) · --:-- IST · Mon–Fri 09:00–18:00 IST · US & EU overlap daily

No newsletter, no CRM. Just a reply.