> ## Documentation Index
> Fetch the complete documentation index at: https://hercules.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Mobile Apps

> Turn your Hercules app into a mobile app. Install it from the web as a PWA, or publish it to Google Play and the App Store. Push notifications and camera.

Turn your Hercules app into a mobile app that people install on their phone. Install it from the web as a PWA in seconds, or [publish it to Google Play and the App Store](/docs/apps/mobile/publish-app-store). [Test it on a real device](/docs/apps/mobile/test-mobile) first.

<div className="screenshot purple">
  <img src="https://mintcdn.com/zeus-0f6dadbf/keVYHauo86bdUc4o/images/apps/mobile/mobile-choose-distribution.png?fit=max&auto=format&n=keVYHauo86bdUc4o&q=85&s=dffc8db0b85af113327570b7267cdddc" alt="Mobile tab asking you to choose between installing from the web and publishing to the app stores" width="1568" height="585" data-path="images/apps/mobile/mobile-choose-distribution.png" />
</div>

### How do I get started?

1. Click **Mobile** in the Sidebar
2. Click **Enable mobile support**. Hercules adds a web app manifest (the file that names your app and its icon), icons, and a service worker (a script that lets your app open without a connection)
3. Install it on your phone from the web by following the steps on screen. When you are ready for the stores, click **Publish to App Store**

<div className="screenshot sunset">
  <img src="https://mintcdn.com/zeus-0f6dadbf/keVYHauo86bdUc4o/images/apps/mobile/mobile-enable-support.png?fit=max&auto=format&n=keVYHauo86bdUc4o&q=85&s=fa65e2e36b0d9cfe0af3bce103ad291d" alt="Mobile tab with the Enable mobile support button" width="1563" height="511" data-path="images/apps/mobile/mobile-enable-support.png" />
</div>

To make the layout work better on small screens, ask Hercules:

```text Optimize for mobile wrap theme={}
Optimize my app for mobile
```

### How do I publish my app to the App Store?

<Card title="Publish to App Store" icon="store" horizontal href="/docs/apps/mobile/publish-app-store" arrow>
  Submit your app to the App Store and Google Play
</Card>

### What is a PWA?

A Progressive Web App (PWA) installs on a phone like a native app. It has an app icon, opens full screen, starts without a connection, and can send push notifications.

### What can my mobile app do?

What works depends on how people install your app:

| Feature | Installed from the web (PWA) | Android app (Google Play) | iOS app (App Store) |
| - | - | - | - |
| Push notifications | Yes. On iPhone, after **Add to Home Screen** (iOS 16.4 or later) | Not today | Yes, with **iOS push notifications** on |
| Camera | Yes | Yes, with **Camera** on | Yes, with **Camera** on |
| Microphone | Yes | Yes, with **Microphone** on | Yes, with **Microphone** on |
| Location while the app is open | Yes | Yes, with **Location** on | Yes, with **Location** on |
| Home screen icon | Yes | Yes | Yes |

The store app settings are in **App settings** (the gear icon next to your app name). A store build only has what was on when it was built, so build again after you change them.

### What can't my mobile app do?

Hercules store builds include no native features beyond the ones above, so these do not work today:

* **Background location** (seeing where someone is while the app is closed) and **background audio** (playing with the app closed or the screen locked)
* **Custom native plugins or SDKs**, such as AdMob, in-app purchase (StoreKit or Google Play Billing), Bluetooth, or syncing phone contacts
* **Push notifications in the Android app**

To sell or show ads in a store app, see [payments and ads in store apps](/docs/apps/mobile/store-requirements#can-i-sell-things-in-my-store-app).

### What is inside the Android and iOS apps?

Hercules wraps your published app in a small native app built with Capacitor (an open source app shell). The native app shows your app in the phone's built-in web view, so changes you publish reach it the next time it opens. See [Update Your App](/docs/apps/mobile/update-mobile-app).

* **Android:** a Capacitor app that shows your app in Android WebView. It is not a Trusted Web Activity (TWA, a format that runs your app in Chrome). A browser-based TWA option shows on the build step only for accounts in an early test today
* **iOS:** a Capacitor app that shows your app in WKWebView, the iPhone's built-in web view, plus Apple push notifications when you turn them on
* **Telling the app apart from the website:** the store app adds `HerculesNative` to its user agent (the text a browser sends to identify itself). Ask Hercules to use it to hide what a store does not allow, such as checkout for digital items
* **Code export:** [Download App Code](/docs/apps/export-data) contains your web app's code only. Hercules creates the Android and iOS projects for each build, and they are not part of the export
* **Android signing:** Hercules creates the upload key on your first Android build and keeps it. See [Do I need to save my Android signing key?](/docs/apps/mobile/publish-app-store#do-i-need-to-save-my-android-signing-key)

### How does sign-in work in the store app?

Your store app uses the same Hercules Auth sign-in as your website:

| Sign-in method | In the store app |
| - | - |
| Email code, email and password, username and password, SMS code | Stays inside the app |
| Google, Apple, Microsoft, Facebook, LinkedIn | Opens the phone's browser, then hands the session back to the app |

Google does not allow its sign-in page inside an app's web view, so social sign-in finishes in the phone's browser:

1. The person taps a social sign-in button, and the phone's default browser opens
2. They sign in there. The browser then shows a **Return to the app** page, which asks them to close the tab and switch back to your app
3. They switch back to your app, and it finishes signing them in

**Return to the app** means the browser part is done. The browser cannot bring your app back to the front today, so people switch back themselves. The app waits up to 10 minutes. After that, or if the app still shows the sign-in page, tap the sign-in button again.

Links in emails, such as email verification and password reset links, open in the browser, not in the app. After using one, go back to the app and sign in.

For App Review, give the reviewer an account that signs in with a password. See [demo accounts](/docs/apps/mobile/store-requirements#how-do-i-give-reviewers-a-demo-account).

***

<Card icon="store" horizontal href="/docs/apps/mobile/publish-app-store" title="Ready to publish?" arrow>
  Submit your app to the App Store and Google Play
</Card>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.