Get started
Introduction
Installation
Your first app
Tutorials
Fission tutorials
Use Fission’s limited iOS volume-control capability
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 →

Use Fission’s limited iOS volume-control capability

Inspect the real volume provider and its unsupported iOS result. The native volume-control goal is still blocked.
iOS

What you will build

Establish the missing iOS volume operation without presenting a simulated slider as working device control.
Request an actual read-only media-volume result through effects
Report the current iOS provider gap without substituting a memory value
Keep desktop readings separate from the still-unfulfilled native iOS goal
Status: blocked — this tutorial does not yet meet its native iOS goal. The current iOS provider cannot read, set or adjust the volume. The earlier memory-backed example made that boundary look like a working feature; it was not one.
Volume inside a media player and the device's volume are different controls. Changing a number in app state demonstrates neither. The diagnostic below requests an actual media-stream reading and reports the host's real result. It contains no slider which suggests that an unsupported system control has been implemented.

Create a diagnostic project, not a simulated feature

Complete iOS setup first. These commands declare the capability and generate platform inputs; they do not remove the native provider gap.
cargo install cargo-fission
fission init ios-use-fissions-limited-ios-volume-control-capability
cd ios-use-fissions-limited-ios-volume-control-capability
fission add-target ios --project-dir .
fission add-capability volume-control --project-dir .
cargo add serde_yaml

Run the finished example

fission run --target ios --project-dir .

1. Ask the actual provider

Keep the generated src/main.rs and replace the shared files below. The view is side-effect-free; the explicit button queues one request, binds both unit completion actions and decodes the actual typed response. Neither the normal launcher nor the preview installs a memory provider.
{"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/screen.rs","value":"src-app-screen-rs"},{"index":3,"label":"src/i18n.rs","value":"src-i18n-rs"},{"index":4,"label":"src/lib.rs","value":"src-lib-rs"},{"index":5,"label":"preview/lib.rs","value":"preview-lib-rs"},{"index":6,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"},{"index":7,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}]}
{"id":"fission-tabs-1","index":0,"label":"src/app.rs","value":"src-app-rs"}
mod screen;
pub mod state;
pub use screen::VolumeDiagnosticScreen;
pub use state::VolumeDiagnosticState;
{"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 VolumeDiagnosticState {
    pub locale: Locale,
    pub pending: bool,
    pub message_key: String,
    pub diagnostic: Option<String>,
}
impl Default for VolumeDiagnosticState {
    fn default() -> Self {
        Self {
            locale: Locale::from("en-US"),
            pending: false,
            message_key: "check.ready".into(),
            diagnostic: None,
        }
    }
}
impl GlobalState for VolumeDiagnosticState {}

pub fn check_host(
    state: &mut VolumeDiagnosticState,
    cx: &mut ReducerContext<VolumeDiagnosticState>,
) {
    if state.pending {
        return;
    }
    state.pending = true;
    state.message_key = "check.pending".into();
    state.diagnostic = None;
    let ok = cx.effects.bind(HostChecked, reduce_with!(host_checked));
    let err = cx
        .effects
        .bind(HostCheckFailed, reduce_with!(host_check_failed));
    cx.effects
        .volume()
        .get_level(VolumeStream::Media)
        .on_ok(ok)
        .on_err(err);
}

#[fission_reducer(HostChecked)]
fn host_checked(state: &mut VolumeDiagnosticState, cx: &mut ReducerContext<VolumeDiagnosticState>) {
    state.pending = false;
    match cx.input.capability_ok(GET_VOLUME_LEVEL) {
        Some(value) => {
            state.message_key = if true {
                "check.available"
            } else {
                "check.unavailable"
            }
            .into();
            state.diagnostic = Some(format!("{value:?}"));
        }
        None => state.message_key = "check.invalid".into(),
    }
}

#[fission_reducer(HostCheckFailed)]
fn host_check_failed(
    state: &mut VolumeDiagnosticState,
    cx: &mut ReducerContext<VolumeDiagnosticState>,
) {
    state.pending = false;
    match cx.input.capability_error(GET_VOLUME_LEVEL) {
        Some(error) => {
            state.message_key = if error.code == "unsupported" {
                "check.unavailable"
            } else {
                "check.failed"
            }
            .into();
            state.diagnostic = Some(format!("{}: {}", error.code, error.message));
        }
        None => state.message_key = "check.invalid".into(),
    }
}
{"id":"fission-tabs-1","index":2,"label":"src/app/screen.rs","value":"src-app-screen-rs"}
use super::state::{check_host, VolumeDiagnosticState};
use fission::prelude::*;

fission_component! {
    pub VolumeDiagnosticScreen<VolumeDiagnosticState> {}
    view(_screen, state, cx) {
        let tokens = &cx.view.env().theme.tokens;
    } => SafeArea(child: Scroll(child: Container(
        Column(gap: tokens.spacing.m, children: [
            Text(cx.tr("check.heading")).size(tokens.typography.heading2_size),
            Text(cx.tr("check.blocked")).color(tokens.colors.text_secondary),
            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"); }),
            ]),
            Button(child: Text(cx.tr("check.request")), key: "check-host", disabled: state.pending,
                on_press: reduce { check_host(state, cx); })
                .semantics_identifier("host.check"),
            if state.pending {
                Spinner(motion: Some(SpinnerMotion::Default), label: Some(cx.tr("check.pending")))
            },
            Text(cx.tr(&state.message_key)),
            if let Some(details) = &state.diagnostic { Code(text: details.clone()) },
            Text(cx.tr("check.scope")).color(tokens.colors.text_secondary),
        ])
    ).padding_all(tokens.spacing.l)))
}
{"id":"fission-tabs-1","index":3,"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 task translations");
        env.i18n.add_bundle(TranslationBundle {
            locale: Locale::from(locale),
            messages,
        });
    }
    env
}

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

use app::{VolumeDiagnosticScreen, VolumeDiagnosticState};
use fission::prelude::*;

#[cfg(not(any(target_arch = "wasm32", target_os = "android", target_os = "ios")))]
pub fn run_desktop() -> anyhow::Result<()> {
    DesktopApp::<VolumeDiagnosticState, _>::new(VolumeDiagnosticScreen)
        .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::<VolumeDiagnosticState, _>::new(VolumeDiagnosticScreen)
        .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::<VolumeDiagnosticState, _>::new(VolumeDiagnosticScreen)
        .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::<VolumeDiagnosticState, _>::new(VolumeDiagnosticScreen)
        .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":5,"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::VolumeDiagnosticState, _>::new(app::VolumeDiagnosticScreen)
        .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":6,"label":"i18n/en-US.yaml","value":"i18n-en-us-yaml"}
check.heading: "Check the active volume provider"
check.blocked: "The native iOS tutorial goal is blocked. This screen checks a prerequisite; it does not implement the promised feature."
check.request: "Check the active host"
check.ready: "No host check has been requested."
check.pending: "Waiting for the host…"
check.available: "A provider returned a volume reading. This does not establish iOS support."
check.unavailable: "The active host cannot provide this prerequisite or operation."
check.failed: "The host check failed. Inspect the diagnostic details."
check.invalid: "The host returned no usable typed result."
check.scope: "This is an integration diagnostic, not a completed native workflow."
language.english: "English"
language.spanish: "Español"
{"id":"fission-tabs-1","index":7,"label":"i18n/es-ES.yaml","value":"i18n-es-es-yaml"}
check.heading: "Comprueba el proveedor de volumen"
check.blocked: "El objetivo nativo de iOS está bloqueado. Esta pantalla comprueba un requisito; no implementa la función prometida."
check.request: "Comprobar el host activo"
check.ready: "No se ha solicitado ninguna comprobación."
check.pending: "Esperando al host…"
check.available: "Un proveedor devolvió un nivel de volumen. Esto no demuestra compatibilidad con iOS."
check.unavailable: "El host activo no puede proporcionar este requisito u operación."
check.failed: "La comprobación falló. Revisa los detalles de diagnóstico."
check.invalid: "El host no devolvió un resultado tipado utilizable."
check.scope: "Es un diagnóstico de integración, no un flujo nativo completo."
language.english: "Inglés"
language.spanish: "Español"
{"id":"fission-tabs-1"}
Run the host check. Inspect the actual response and the blocked-goal notice together. A successful request transport is not proof that the requested capability exists.
Show the app preview
Hide the app preview

2. Keep the missing integration visible

The default native volume provider has macOS and Linux implementations. Its iOS path returns an unsupported operation for get_level, set_level and adjust_level. Adding the capability declaration does not change that provider.
The diagnostic uses get_level because it is read-only. On a desktop whose native provider implements that operation, a reading may be returned. The browser and iOS results must be recorded independently; desktop success does not fill the iOS gap.
A complete tutorial still needs an approved native implementation and a precise account of which volume it controls, followed by physical-device checks. Until then, this page provides integration diagnostics only. It must not be listed as a completed volume-control workflow.
Retry the check and change language. There must be no fabricated record, credential, saved setting or completed operation. The diagnostic output is developer evidence, not a user-facing success receipt.
Show the app preview
Hide the app preview

3. What still has to be established

On macOS, launch the actual generated iOS host:
fission doctor ios --project-dir .
fission devices --project-dir .
fission run --target ios --project-dir .
fission test --target ios --project-dir .
These commands can check setup and launch. They cannot certify a missing provider. Follow physical iPhone installation when the real native integration is available.
Before calling this goal complete, establish a real supported iOS operation and show the value obtained from it. Check hardware volume buttons, muted state, unsupported streams and failures on a physical iPhone. Do not manufacture a successful callback or silently fall back to an unrelated in-app preference.