Answers · Mobile

How do I change which screens open as modals in the native app?

Edit the path configuration your server returns at /configurations/:platform. The shells fetch it at launch, so changing which URLs open as modals, which replace the current screen and which are handled natively is a deploy, not a new binary and not a review.

Where it lives

bin/rails routes | grep configurations

The route is declared in config/routes.rb, constrained to ios or android, and handled by a controller that returns the rules as JSON. Because it is served rather than compiled in, it is changeable at the same speed as everything else on your server.

What the rules do

Each rule matches a URL pattern and sets a presentation. The common ones:

  • Modal for anything that is a task rather than a place: a new record form, a confirmation.
  • Replace for a screen that should not add to the back stack, such as a post-submit result.
  • Native for the marker paths the shell must intercept rather than load, which is how the in-app purchase sheet appears.

Per platform, deliberately

The route takes a platform because iOS and Android have different navigation conventions, and pretending otherwise produces an app that feels wrong on one of them. A sheet that is right on iOS may want to be a full screen on Android.

Test the back behavior

The failure this causes is not a crash, it is a back button that goes somewhere unexpected. After changing a rule, walk the flow forwards and backwards on a device. A modal that pushes instead of presenting leaves users on a screen with no way out, and that is a rejection as well as a bug.

Do not put logic here

Path configuration decides presentation, not permissions. A screen that should be hidden from unentitled accounts is gated in the controller with the concern in app/controllers/concerns/require_entitlement.rb, not by omitting a navigation rule. The URL is still reachable, and a rule is not a gate.

Changing it is instant, within reason

The shells fetch the configuration at launch, so a change lands on the next cold start rather than mid-session. That is fast enough to fix a navigation bug the same day, which is the whole point of serving it.

Related questions

Can I put a Rails app in the App Store and Play Store?

Yes. Hotwire Native wraps your existing web views in a native shell, so the screens you already built are the screens in the app. One Shot ships both shells in mobile/ios and mobile/android. The rule you cannot route around is that digital subscriptions have to use the platform's in-app purchase, not Stripe.

Do I need to rebuild a Hotwire Native app to change a screen?

No. The screens are your web views, served from your Rails app, so a deploy changes what users see on their next launch with no build and no App Store review. Even navigation rules are served, from /configurations/:platform. A new binary is only needed for the icon, native capabilities, or the shell itself.

How do I keep a web app and its native shells consistent?

Keep the shells thin and let the server decide. Screens, navigation rules and feature gates all come from Rails, so they stay consistent by construction. The only things that should live in mobile/ios and mobile/android are the icon, the purchase sheet and anything the web genuinely cannot do.