01 — Guides · 2 min read

Embedding an event map in your app: a WebView checklist

Embedding a map in an event app takes a WebView and a few details that are easy to miss. Go through this list before the app goes to the stores.

URL and language

Open the map URL for the event and pass the app’s language (?lang=). If the app lets people switch language, call the bridge so the map follows without reloading.

Message handlers

Register the handler the map posts to: a WKScriptMessageHandler on iOS, a JavaScript interface on Android, onMessage in react-native-webview. Use the names from the map’s configuration.

Wait for “ready”

Do not call the map before it has loaded. Wait for the ready event, check the bridge version it reports, then send commands such as opening a place or building a route.

Use the events

The map tells the app when a place is opened, a route is built or something is shared. Use the share events to open the app’s own share sheet instead of the browser’s.

A push notification or a QR code can carry a map link — a place, a route, a language. Route these links into the WebView so they open at the right spot.

Offline on iOS and Android

The map works offline through a service worker. In WKWebView on iOS, service workers only run for App-Bound Domains: list the map’s domain under WKAppBoundDomains in Info.plist and limit navigation to app-bound domains.

On Android, enable JavaScript and DOM storage in the WebView settings so the map can keep its data.

Permissions and push

Location and the camera (for QR codes) are granted to the app; pass them on to the WebView only if the map needs them.

Web push does not work inside a WebView. Send notifications from the app, and connect the map’s alerts to your push service.

Test like a visitor

Before release, check on real devices:

  • The map opens in the app language
  • A place opened from a native screen shows its card
  • Share opens the app’s share sheet
  • A link from a push notification lands on the right place
  • The map loads in airplane mode after one online visit
  • Safe areas and the back gesture behave as in the rest of the app

Festival map app
Noctara Run: a race course map demo

Finish

Planning a festival?

Send the site plan, the stages and the dates — you will get an answer with what your festival map would take.