Get started
Introduction
Installation
Your first app
Tutorials
Fission tutorials
Share one Fission app core between Android and iOS
Core concepts
Components
State and effects
Protected routes
Server-side rendering
Styling
Testing
Deployment
Reference
API reference
Cookbook
Fission 0.16.0
Documentation version
Read the changelog →

Share one Fission app core between Android and iOS

Share an editable checklist, record rules, translations and reusable Compose rows between thin Android and iOS entrypoints.
Android

What you will build

Keep the checklist's behaviour in one Rust core whilst each mobile host supplies only its actual launch and platform setup.
Use one authority for check records and completion
Keep local draft and disclosure memory in the components which own it
Install equivalent shared setup and test the same journey on both targets
Sharing code is useful only if it includes the behaviour which would otherwise diverge. Putting the same colours in two apps whilst maintaining two versions of the checklist rules would leave the important duplication untouched.
Here, the user creates inspection checks, completes them and filters the list. The records and their completion state have one authority in shared Rust. The screen owns its draft and display filter; each repeated row owns only its details disclosure. Android and iOS hosts launch that same app rather than reconstructing its rules.

Add the targets without replacing the app

Start from the existing project's root. Do not run fission init over it.
fission add-target android ios --project-dir .
Inspect the manifest and configuration diff, then read platforms/android/README.md and platforms/ios/README.md. Complete Android SDK/NDK setup and Xcode/iOS setup before launching those hosts.
If you need a separate worked example, create this one instead of overwriting an existing product:
fission init mobile-share-one-fission-app-core-between-android-and-ios
cd mobile-share-one-fission-app-core-between-android-and-ios
fission add-target android ios --project-dir .
cargo add serde_yaml

Run the finished example

fission run --target android --project-dir .

1. Give the shared core a useful responsibility

This complete example reuses the editable checklist rather than presenting a different fake work order for each target. Keep the generated src/main.rs; the shared src/lib.rs below supplies its normal target entrypoints.
state.rs owns the records and creation rule. row.rs is a named reusable component, and screen.rs composes the workflow. The i18n setup is also shared. A larger app would put routes and services alongside these modules, not inside generated platform packaging files.
{"id":"fission-tabs-1","tabs":[{"index":0,"label":"src/app.rs","value":"src-app-rs"},{"index":1,"label":"src/app/state.rs","value":"src-app-state-rs"},{"index":2,"label":"src/app/row.rs","value":"src-app-row-rs"},{"index":3,"label":"src/app/screen.rs","value":"src-app-screen-rs"},{"index":4,"label":"src/i18n.rs","value":"src-i18n-rs"},{"index":5,"label":"src/lib.rs","value":"src-lib-rs"},{"index":6,"label":"preview/lib.rs","value":"preview-lib-rs"},{"index":7,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":8,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
pub mod row;
pub mod screen;
pub mod state;

pub use screen::ChecklistScreen;
pub use state::ChecklistState;
{"id":"fission-tabs-1","index":1,"label":"src/app/state.rs","value":"src-app-state-rs"}
use fission::prelude::*;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ChecklistItem {
    pub id: u64,
    pub title: String,
    pub complete: bool,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct ChecklistState {
    pub items: Vec<ChecklistItem>,
    pub next_id: u64,
    pub locale: Locale,
}

impl Default for ChecklistState {
    fn default() -> Self {
        Self {
            items: Vec::new(),
            next_id: 1,
            locale: Locale::from("en-US"),
        }
    }
}

impl GlobalState for ChecklistState {}

pub fn add_item(state: &mut ChecklistState, title: &str) {
    let title = title.trim();
    if title.is_empty() {
        return;
    }
    let Some(next) = state.next_id.checked_add(1) else {
        return;
    };
    state.items.push(ChecklistItem {
        id: state.next_id,
        title: title.to_owned(),
        complete: false,
    });
    state.next_id = next;
}
{"id":"fission-tabs-1","index":2,"label":"src/app/row.rs","value":"src-app-row-rs"}
use super::state::ChecklistState;
use fission::prelude::*;

fission_component! {
    pub ChecklistRow<ChecklistState> {
        props {
            item_id: u64,
            title: String,
            complete: bool,
        }
        state {
            expanded: bool = false,
        }
    }
    view(row, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
        let status = if row.complete {
            cx.tr("item.complete")
        } else {
            cx.tr("item.pending")
        };
    } => SemanticsRegion(
        identifier: Some(format!("checklist.item.{}", row.item_id)),
        child: Container(
        Column(gap: tokens.spacing.s, children: [
            Text(row.title.clone()).weight(tokens.typography.font_weight_semibold),
            Text(status),
            Row(gap: tokens.spacing.s, wrap: ir_op::FlexWrap::Wrap, children: [
                Button(
                    child: Text(if row.complete { cx.tr("item.reopen") } else { cx.tr("item.finish") }),
                    key: "toggle-completion",
                    on_press: reduce {
                        if let Some(item) = state.items.iter_mut().find(|item| item.id == row.item_id) {
                            item.complete = !item.complete;
                        }
                    },
                ),
                Button(
                    child: Text(if row.expanded { cx.tr("item.hide") } else { cx.tr("item.details") }),
                    key: "toggle-details",
                    on_press: reduce { row.expanded = !row.expanded; },
                ),
            ]),
            if row.expanded {
                Text(cx.tr("item.detail_summary").replace("{title}", &row.title))
            },
        ]),
    )
    .padding_all(tokens.spacing.m)
    .border(tokens.colors.border, 1.0)
    .border_radius(tokens.radii.medium),
    )
}
{"id":"fission-tabs-1","index":3,"label":"src/app/screen.rs","value":"src-app-screen-rs"}
use super::row::ChecklistRow;
use super::state::{add_item, ChecklistState};
use fission::prelude::*;

fission_component! {
    pub ChecklistScreen<ChecklistState> {
        state {
            draft: String = String::new(),
            filter: String = String::new(),
            reversed: bool = false,
        }
    }
    view(screen, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
        let query = screen.filter.to_lowercase();
        let mut visible: Vec<_> = state.items.iter()
            .filter(|item| item.title.to_lowercase().contains(&query))
            .collect();
        if screen.reversed {
            visible.reverse();
        }
    } => SafeArea(
        child: Scroll(
            child: Container(
                Column(gap: tokens.spacing.m, children: [
                    Text(cx.tr("list.title")).size(tokens.typography.heading2_size),
                    Text(cx.tr("list.explanation")),
                    Row(gap: tokens.spacing.s, children: [
                        Button(
                            child: Text(cx.tr("language.english")),
                            key: "english",
                            on_press: reduce { state.locale = Locale::from("en-US"); },
                        ),
                        Button(
                            child: Text(cx.tr("language.spanish")),
                            key: "spanish",
                            on_press: reduce { state.locale = Locale::from("es-ES"); },
                        ),
                    ]),
                    FormControl(
                        label: Some(cx.tr("list.new_item")),
                        required: true,
                        child: TextInput(
                            value: screen.draft.clone(),
                            bind(on_input): to(screen.draft),
                        ),
                    ),
                    Button(
                        child: Text(cx.tr("list.add")),
                        key: "add-item",
                        disabled: screen.draft.trim().is_empty() || state.next_id == u64::MAX,
                        on_press: reduce {
                            add_item(state, &screen.draft);
                            screen.draft.clear();
                        },
                    ),
                    TextInput(
                        value: screen.filter.clone(),
                        bind(on_input): to(screen.filter),
                        label: Some(TextContent::Key("list.filter".into())),
                    ),
                    Button(
                        child: Text(cx.tr("list.reverse")),
                        key: "reverse-order",
                        on_press: reduce { screen.reversed = !screen.reversed; },
                    ),
                    if visible.is_empty() {
                        Text(cx.tr("list.empty"))
                    },
                    for item in visible {
                        ChecklistRow(
                            item.id,
                            item.title.clone(),
                            item.complete,
                            key: item.id,
                        )
                    },
                ]),
            )
            .padding_all(tokens.spacing.l)
            .bg(tokens.colors.surface),
        ),
    )
}
{"id":"fission-tabs-1","index":4,"label":"src/i18n.rs","value":"src-i18n-rs"}
use fission::i18n::{Locale, TranslationBundle};
use fission::prelude::*;
use std::collections::HashMap;

pub fn create_env() -> Env {
    let mut env = Env::default();
    env.locale = Locale::from("en-US");
    for (locale, source) in [
        ("en-US", include_str!("../i18n/en-US.yaml")),
        ("es-ES", include_str!("../i18n/es-ES.yaml")),
    ] {
        let messages: HashMap<String, String> =
            serde_yaml::from_str(source).expect("valid checklist translations");
        env.i18n.add_bundle(TranslationBundle {
            locale: Locale::from(locale),
            messages,
        });
    }
    env
}

pub fn sync_env(state: &crate::app::ChecklistState, env: &mut Env) {
    env.locale = state.locale.clone();
}
{"id":"fission-tabs-1","index":5,"label":"src/lib.rs","value":"src-lib-rs"}
pub mod app;
mod i18n;

use app::{ChecklistScreen, ChecklistState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<ChecklistState, _>::new(ChecklistScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(any(target_os = "android", target_os = "ios"))]
pub fn run_mobile() -> anyhow::Result<()> {
    MobileApp::<ChecklistState, _>::new(ChecklistScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
}

#[cfg(target_os = "android")]
#[no_mangle]
fn android_main(app_handle: AndroidApp) {
    let _ = MobileApp::<ChecklistState, _>::new(ChecklistScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run_with_android_app(app_handle);
}

#[cfg(target_arch = "wasm32")]
#[wasm_bindgen::prelude::wasm_bindgen(start)]
pub fn run_web() -> Result<(), wasm_bindgen::JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<ChecklistState, _>::new(ChecklistScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .run()
        .map_err(|error| wasm_bindgen::JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":6,"label":"preview/lib.rs","value":"preview-lib-rs"}
mod app;
mod i18n;

use fission::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub fn run() -> Result<(), JsValue> {
    console_error_panic_hook::set_once();
    WebApp::<app::ChecklistState, _>::new(app::ChecklistScreen)
        .with_env(i18n::create_env())
        .with_sync_env(i18n::sync_env)
        .mount("#fission-web-mount")
        .run()
        .map_err(|error| JsValue::from_str(&error.to_string()))
}
{"id":"fission-tabs-1","index":7,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
list.title: "Your inspection checklist"
list.explanation: "Add your own checks, open one row's details, then reverse the order. The details must not move to another item."
list.new_item: "New inspection check"
list.add: "Add check"
list.filter: "Filter checks by title"
list.reverse: "Reverse displayed order"
list.empty: "No checks match. Add a check or clear the filter."
item.complete: "Complete"
item.pending: "Not complete"
item.reopen: "Reopen check"
item.finish: "Mark complete"
item.details: "Show details"
item.hide: "Hide details"
item.detail_summary: "Details for: {title}. Completion belongs to the checklist record; whether this panel is open belongs to this row."
language.english: "English"
language.spanish: "Español"
{"id":"fission-tabs-1","index":8,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
list.title: "Tu lista de inspección"
list.explanation: "Añade tus comprobaciones, abre los detalles de una fila e invierte el orden. Los detalles no deben pasar a otro elemento."
list.new_item: "Nueva comprobación"
list.add: "Añadir comprobación"
list.filter: "Filtrar comprobaciones por título"
list.reverse: "Invertir el orden mostrado"
list.empty: "No hay coincidencias. Añade una comprobación o borra el filtro."
item.complete: "Completada"
item.pending: "Sin completar"
item.reopen: "Reabrir comprobación"
item.finish: "Marcar como completada"
item.details: "Mostrar detalles"
item.hide: "Ocultar detalles"
item.detail_summary: "Detalles de: {title}. La finalización pertenece al registro; el estado abierto de este panel pertenece a esta fila."
language.english: "Inglés"
language.spanish: "Español"
{"id":"fission-tabs-1"}
Create two checks, including two with the same title. Complete one and reverse the display order. The record remains the same because its identity comes from its allocated ID, not its position or text.
Show the app preview
Hide the app preview

2. Keep the launchers thin without losing setup

The native and Web entrypoints configure the same ChecklistState, root component, translation environment and locale synchronization. The Android entrypoint additionally passes its host handle into run_with_android_app. That platform-specific argument does not require a separate checklist implementation.
Keep startup hydration, route registration, custom design-system installation and asynchronous job registration consistent when your real app needs them. “Thin” means those entrypoints install the shared setup; it does not mean omitting a setup step on one platform. Request host operations through effects from shared reducers, then install only a genuine target-specific provider at the shell boundary.
The keys in this example preserve row identity during reordering. They do not keep unmounted local disclosure state alive after filtering. Completion survives filtering because it belongs to the app's records, not because a hidden widget secretly persists.
Filter a completed row out and clear the filter. Its completion must remain. Its disclosure may reset after unmounting; that is an intentional distinction between domain data and local presentation memory.
Show the app preview
Hide the app preview

3. Run the same journey on both mobile hosts

Use the configured emulator or phone from the Android launch guide. Run the iOS commands on macOS with an installed simulator runtime.
fission doctor android --project-dir .
fission run --target android --project-dir .
fission test --target android --project-dir .
fission doctor ios --project-dir .
fission run --target ios --project-dir .
fission test --target ios --project-dir .
On each target, add a long check, complete it, filter it out, restore it and switch language. Check the native keyboard, small-screen scrolling and accessibility labels. A browser preview proves neither native host's behaviour; a generated-host smoke test proves neither the record rule nor the rendered journey.
The checklist is session-local. Relaunching clears it because this example has not installed persistence. When adding storage, keep the same shared ownership model and hydrate through a registered startup action rather than reading a database during widget conversion.