Embed in an existing native app
Already have an iOS or Android app? Show your Angular app as one or more screens inside it. You don't have to ship the app that ng build --platform generates.
Embedding means changing your iOS or Android project, in Swift, Objective-C, Kotlin or Java. It's the one place in these docs where you need native knowledge. Work through it with whoever maintains your native app.
How it fits together
Your native app adds the Lynx engine. It shows your bundle in a LynxView: a native view that runs a Lynx bundle, like an <iframe> for Lynx content. You place a LynxView in your own screens, as you would any other native view.
Your native app becomes the host app: the app that loads your bundle and shows it. Build the bundle with plain ng build, as in Build your app.
Add Lynx to your app
Lynx's guides cover the native setup:
- Integrate with Existing Apps adds the Lynx engine to your project. Pick your platform from the tabs.
- Embedding LynxView into Native View sizes a LynxView inside your own screens.
The apps ng build --platform generates use Lynx 4.1.0, the version AngularLynx is tested with.
What your app must do
Beyond Lynx's own setup, your app has three jobs:
Load the bundle
The Lynx engine doesn't fetch bundles itself. Your app gives it a loader that reads them, from the app or from the network:
- iOS: a
LynxTemplateProvider - Android: an
AbsTemplateProvider
Lynx's integration guide shows one for each platform.
Serve static/
Images and fonts your code imports load from /static/... paths. Pick one:
- Ship
static/inside your app, and resolve/static/...paths against where you keep it. The generated apps do this. - Host it on a server, and set RSpeedy's
output.assetPrefixto its URL:
Link XElement
Some elements aren't part of Lynx's core. They come from Lynx's XElement library: <input>, <textarea>, <overlay>, <svg>, <blur-view>, <viewpager>, <refresh>, the <scroll-coordinator> family, <webview> and <video>.
An app that doesn't link XElement and register its elements renders nothing for these tags. On Android, the elements after them can disappear too. Nothing on screen says why.
- Android: add
org.lynxsdk.lynx:xelement, and calladdBehaviors(XElementBehaviors().create())on theLynxViewBuilder. - iOS: add the
XElementpod.
Lynx's integration guide has the details. The apps ng build --platform generates already do this, and so does Lynx Explorer.
Bundled or downloaded
Your app can ship the bundle inside it, or download it from a server:
You can combine both. Ship a bundle with the app for an instant first launch, then check for a newer one in the background.
Before you serve updates this way:
- Match the Lynx version. A bundle only runs on a Lynx engine at least as new as its
targetSdkVersion. That's an AngularLynx plugin option, which defaults to3.2. Every installed version of your app must be able to run what you serve. So raisetargetSdkVersiononly when every installed version's engine is that new. - Check the store rules. Both stores have rules about code an app downloads after review. Read Apple's App Review Guidelines and Google Play's Developer Program Policies before you rely on it.
Copy the iOS extras
The iOS app ng build --platform ios generates adds two things XElement lacks. Copy them to get the same in your app.
Glass that blurs and morphs
XElement's <blur-view> falls short of the glass components:
- Before iOS 26, they draw UIKit's blur materials, which XElement's
<blur-view>doesn't have. - From iOS 26, their glass materializes, dissolves and morphs. XElement's sets at once.
The generated app adds both with a <blur-view> of its own, BlurView.swift, and the GlassTransitions.swift it uses. To get them:
- Copy both files into your app.
- Register
BlurViewforblur-view, in place of XElement'sLynxUIBlurView.
Without them, the components draw Lynx's older blur instead, and their glass comes and goes at once.
Web views that go away
On iOS, XElement's <webview> keeps its web view after the element goes. The WebContent process WebKit started for it stays too. So every <webview> your app shows stays for as long as the app runs, because its loader and its web view keep each other.
The generated app wraps XElement's loader so the web view goes with the element, in WebViewLoader.swift. To get it:
- Copy the file into your app.
- Call
ShellWebViewLoaderProvider.register()before your firstLynxView, where you register XElement's elements.
Connect more native features
Some AngularLynx services call native code in the host app. The generated apps have all of it. In your own app, add what you use:
- Back button, memory and splash screen: the Android back button, freeing the memory closed screens hold, and hiding your loading view once Angular draws.
- Native features: web sign-in, storage, links, shortcuts, the photo picker and the share sheet.
- Pass data from your native app: send values into Angular, such as a signed-in user's ID or the app's theme.
Related
- Pass data from your native app
- Multi-page apps: several bundles, each in its own LynxView.
- Build your app
- Integrate with Existing Apps on lynxjs.org
