Capacitor / Ionic Alternative — Mobile

Capacitor 8 (8.5.3) wraps a built web app (webDir: "dist") in a native WebView and gives it phone features through plugins; React Native renders real native…

Can a finished web app reach the App Store without being rewritten in React Native? It can, through Capacitor (from the Ionic team): it wraps a web app that's already built (HTML, CSS, JavaScript) into an Android and iOS app. Its screens run in a WebView, a "browser without the frame" inside a native app, and phone features are called through plugins. Ionic Framework is a set of web UI components that imitate the look of iOS and Android, usually used on top of Capacitor. That makes three options, much like Mrs. Rini's price leaflet. A PWA is the leaflet customers stick on their own fridge, picked up from the browser. Capacitor is the same leaflet put in a lit frame and displayed in a mall window (the app store). The light is the native features through plugins. React Native is a sign printed to order in the shop's own material: real native components. This lesson weighs all three, including the React Native choice made for Mrs. Rini's Laundry in the second lesson.

Three ways to bring the web to a phone

PWA Capacitor React Native (Expo)
What draws the screens the browser a WebView in a native app (Android System WebView, WKWebView on iOS) native views (UIView on iOS, View on Android)
Web code reused all of it all of it: the dist folder logic and hooks; screens rewritten with View and Text
In the stores no (Android can use a TWA) App Store and Play App Store and Play
Phone features browser APIs Capacitor plugins Expo modules
Fixes without store review deploy the site through a third-party live update service EAS Update

So the fundamental difference: Capacitor wraps the web app in a native WebView, while React Native renders real native components.

Wrapping a web app with Capacitor 8

Versions as of 11 October 2026: @capacitor/core, @capacitor/cli, @capacitor/android and @capacitor/ios 8.5.3. For an existing web app (here a small web version of Mrs. Rini's Laundry that Vite builds into dist):

npm install @capacitor/core
npm install -D @capacitor/cli
npx cap init "Mrs. Rini's Laundry" com.rinislaundry.web --web-dir dist
npm install @capacitor/android @capacitor/ios
npm run build          # Vite writes dist/
npx cap add android    # creates the android/ folder (an Android Studio project)
npx cap add ios        # creates the ios/ folder (an Xcode project)

The result in this lesson's scratchpad:

$ npx cap sync android
✔ Copying web assets from dist to android/app/src/main/assets/public in 111.45ms
✔ copy android in 258.18ms
[info] Found 4 Capacitor plugins for android:
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
       @capacitor/[email protected]
[info] Sync finished in 1.414s

Plugins: camera, push, preferences

The same web code runs in the browser, on Android and on iOS:

// src/js/app.js
import { Capacitor } from '@capacitor/core';
import { Camera } from '@capacitor/camera';
import { Preferences } from '@capacitor/preferences';
import { PushNotifications } from '@capacitor/push-notifications';

const platform = Capacitor.getPlatform(); // 'web', 'android' or 'ios'

const photo = await Camera.takePhoto({ quality: 70 }); // the permission dialog shows on first use
document.querySelector('#receipt').src = photo.webPath ?? '';

await Preferences.set({ key: 'last-order', value: '13' });

// POST /api/me/push-tokens as in the push lesson (the Bearer login token left out)
const sendToServer = (token) =>
  fetch('https://rinislaundry.com/api/me/push-tokens', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ token, platform }),
  });

await PushNotifications.requestPermissions();
await PushNotifications.addListener('registration', (t) => sendToServer(t.value));
await PushNotifications.register();
Need Capacitor plugin In our Expo app
Photo of a receipt @capacitor/camera 8.2.5 expo-camera (the sensors lesson)
Store a small value @capacitor/preferences 8.0.1 MMKV or AsyncStorage
Push @capacitor/push-notifications 8.1.3: APNs and FCM expo-notifications: one Expo token

Ionic Framework: UI that imitates the platform

Capacitor gives you no components at all: the screens are your own HTML and CSS (Tailwind works too). Ionic Framework (@ionic/react 9.0.7) gives components whose style follows the platform:

import { IonApp, IonBadge, IonItem, IonLabel, IonList, setupIonicReact } from '@ionic/react';
import '@ionic/react/css/core.css';

setupIonicReact(); // 'ios' style on an iPhone, 'md' (Material Design) on Android

export function OrderList({ orders }: { orders: Order[] }) {
  return (
    <IonApp>
      <IonList>
        {orders.map((o) => (
          <IonItem key={o.id} button detail>
            <IonLabel>#{o.id} {o.name}</IonLabel>
            <IonBadge slot="end">{o.status}</IonBadge>
          </IonItem>
        ))}
      </IonList>
    </IonApp>
  );
}

PWA: no store at all

Could a web app like BelajarWeb.dev become a Capacitor app?

Technically yes: Vite's webDir: "dist" gets wrapped as is. What to weigh:

Performance and feel

For a list of three orders and a pickup form, all three feel fast. The difference shows in long lists, gestures and animations: in a WebView the browser engine draws everything, and JavaScript, layout and touch events share the page's single main thread; in React Native, lists and gestures are native views, and Reanimated animations run on the UI thread (the animations lesson). Don't trust other people's benchmark numbers: measure on the cheapest Android phone your customers use, with Chrome DevTools (chrome://inspect) for the WebView, or the tools from the performance lesson for React Native.

Mrs. Rini's decision table, revisited

Mrs. Rini's need PWA Capacitor Capacitor + Ionic React Native (Expo)
In the App Store and Play no yes, if it's more than a website yes, if it's more than a website yes
"Ready for pickup" push on an iPhone only from the home screen yes, server to APNs and FCM yes, server to APNs and FCM yes, one Expo token
A list that feels like a built-in app no no imitated yes
Fixes without store review yes through a third party through a third party yes, EAS Update

For Mrs. Rini's customer app, React Native through Expo is still the honest choice: every row says "yes", and the push server is already built for one Expo token. The answer changes when the situation does. Had Mrs. Rini already had a finished ordering website and a web-only team, Capacitor would be the fastest road to the stores. For the till app on her staff's three tablets, a PWA is enough.

⚠️ Missteps when wrapping a web app

TL;DR: Capacitor 8 (8.5.3) wraps a built web app (webDir: "dist") in a native WebView and gives it phone features through plugins; React Native renders real native components. Capacitor fits best when a team already has a web app it wants to turn into a mobile app quickly. The flow is cap init, cap add android/ios, then npm run build and npx cap sync every time; android/ and ios/ are committed. Plugins: Camera.takePhoto() (getPhoto is deprecated), Preferences (UserDefaults, SharedPreferences), and push with an APNs token on iOS and an FCM token on Android. Ionic Framework 9 gives iOS- and Material-style components and imitates their gestures in web code. A PWA skips the stores: the install button is Chrome-only, iPhones go through Add to Home Screen, Web Push needs iOS 16.4 and the home screen; BelajarWeb.dev itself is on Play through a TWA. Weigh guideline 4.2, CORS for https://localhost and capacitor://localhost, and updates that need a build or a third-party live update (Appflow ends late 2027). For Mrs. Rini's customer app, React Native through Expo stays the right choice.

⚡ A WebView or native components

Meaning: Capacitor wraps a built web app into an Android and iOS app: its screens run in a native WebView, and phone features are called through plugins. React Native renders real native components. A PWA is installed from the browser, with no store at all.

⚡ Build, then sync

Write:

npm run build          # Vite writes dist/
npx cap sync android

Meaning: npx cap sync copies dist into the native projects. The web app travels inside the app file, so deploying the site doesn't change apps already installed on customers' phones.

⚡ One token for push?

Guess first: the Capacitor app uses @capacitor/push-notifications. Is one kind of token on the server enough for iPhones and Android?

No. iOS gives an APNs token, Android an FCM token, so the Laravel server has to talk to two services. In Expo, both are wrapped into one ExponentPushToken[...].

Meaning: Capacitor fits best when a team already has a web app it wants in the stores quickly. For Mrs. Rini's customer app, React Native through Expo stays the right choice.

What you will learn