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
cap initwritescapacitor.config.jsonwithappId,appNameandwebDir: "dist"(a.tsfile when TypeScript is installed).npx cap synccopiesdistinto the native projects and updates the plugins. Run it after everynpm run build. The web app travels inside the app file, so deploying the site doesn't change apps already installed.- The Android project has
minSdkVersion 24andtargetSdkVersion 36; the iOS project needs iOS 15.0 and uses Swift Package Manager (Package.swift), with no CocoaPods. - The
android/andios/folders are source code you commit and edit in Android Studio or Xcode. That's the opposite of Expo CNG, which regenerates those folders fromapp.json. npx cap open androidopens Android Studio,npx cap run iosruns a debug build on a simulator or phone.
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();
Camera.takePhoto()exists since camera plugin 8.1.0. The old material'sCamera.getPhoto()is now deprecated.Preferencesstores toUserDefaultson iOS andSharedPreferenceson Android. Its README says mobile OSs may clearlocalStoragefrom time to time, which is why the plugin exists.- The token from
registrationdiffers per platform: an APNs token on iOS, an FCM token on Android (which needsgoogle-services.jsonfrom Firebase). So the Laravel server has to talk to two services: APNs and FCM. In Expo, both are wrapped into oneExponentPushToken[...]for one API.
| 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>
);
}
- Ionic 9 (released 19 August 2026) needs iOS 16 or later, React 18 or 19, and Capacitor 7 or later.
- The iOS swipe-back gesture is rewritten in web code:
swipeGestureon Ionic's router outlet is on by default iniosmode. It feels close, but it isn't the system's own gesture.
PWA: no store at all
- The install button. The
beforeinstallpromptevent only exists in Chromium-based browsers: Chrome, Edge, Opera and Samsung Internet. Safari and Firefox don't have it. On an iPhone, customers pick Share, then Add to Home Screen themselves; since iOS 26, any site added to the home screen opens as a web app. - Push on an iPhone. Web Push works on iOS 16.4 and later, and only for web apps added to the home screen. Inside a WebView (Android or iOS), Web Push isn't available: that's why Capacitor uses a native push plugin.
- A real example: BelajarWeb.dev itself. This site is a Vite and React app with
vite-plugin-pwa, and it's on Google Play as "Hyper Sheets - Learn Web Dev" through a TWA (Trusted Web Activity): Chrome shows the PWA full screen, and/.well-known/assetlinks.jsonproves the app and the site belong to the same owner. TWAs only exist on Android.
Could a web app like BelajarWeb.dev become a Capacitor app?
Technically yes: Vite's webDir: "dist" gets wrapped as is. What to weigh:
- The App Store. Guideline 4.2: "Your app should include features, content, and UI that elevate it beyond a repackaged website." A website that's only wrapped risks rejection. Add what makes it an app: push, the camera, working offline.
- The origin changes. Pages in Capacitor run at
https://localhost(Android) andcapacitor://localhost(iOS), so the Laravel API has to allow those two origins in CORS. - Updates. The web code lives inside the app, so a server deploy doesn't reach phones. Ionic Appflow (the official live updates) stopped taking new customers on 11 February 2025 and ends on 31 December 2027; the alternatives are third-party services such as Capgo or Capawesome Cloud.
- WebView versions. Android System WebView updates through the Play Store, while WKWebView follows the iOS version. Capacitor treats an Android WebView below version 60 as unsupported (
minWebViewVersion).
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
server.urlshipping in a release build. Capacitor's own config docs say "This is not intended for use in production." Customers' apps would try to load the dev server on your laptop and fail. Use it for live reload only.- Forgetting
npx cap syncafternpm run build. The app still carries the olddist. - Wrapping a website with no app features. It risks rejection under App Store guideline 4.2.
- Expecting one push token to be enough. Capacitor gives an APNs token on iOS and an FCM token on Android.
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.