Mobile Apps (WebView)
Run 155.io games inside a native iOS or Android app
155.io games run inside native mobile apps using iOS WKWebView and Android WebView. The launch flow is the same as in a browser: request a URL from Get Game URL (with platform set to MOBILE or TABLET) and load it in the WebView.
Recommended setup
Load the launch URL directly in the WebView, not inside an iframe on a page of your own. The game's session cookie is then first-party, so page reloads keep the player signed in and nothing else needs configuring.
If you also want the game's Iframe Events, see Receiving game events below.
WebView requirements
| Requirement | iOS (WKWebView) | Android (WebView) |
|---|---|---|
| JavaScript and DOM storage | On by default | setJavaScriptEnabled(true) and setDomStorageEnabled(true) — both off by default |
| Inline video and autoplay | allowsInlineMediaPlayback = true and mediaTypesRequiringUserActionForPlayback = [] | setMediaPlaybackRequiresUserGesture(false) |
| Minimum version | iOS 16.4 or newer | Current Android System WebView |
- Live video is a receive-only WebRTC stream. The game never asks for camera or microphone access. The video starts muted, and sound turns on after the player's first tap.
- User agent: keep the WebView's standard user agent. Appending your own token is fine. The game picks its phone or tablet layout from the user agent, so replacing it entirely can show the desktop layout.
- Orientation: on phones the game is played in portrait. In landscape the game shows a prompt asking the player to rotate the device.
Launch URLs are single-use
The launch URL contains a one-time login code. Request a fresh URL every time the player opens the game, or returns to it after the app was closed or the session ended. Do not save the URL or restore it later — once the code has been used, loading the same URL again fails.
Navigation and links
- Back to Home and Deposit appear in the game menu only when you pass
lobbyUrlanddepositUrlto Get Game URL. They navigate the whole WebView to that URL. Intercept those URLs in your navigation handler (shouldOverrideUrlLoadingon Android,decidePolicyFor navigationActionon iOS) to close the game or open your native cashier. If you don't passlobbyUrl, give players your own way to close the game. - A few links open in a new window, such as the provably-fair verifier and the round lookup page. A WebView ignores these unless your app handles new windows — implement
onCreateWindow(withsetSupportMultipleWindows(true)) on Android orwebView(_:createWebViewWith:for:windowFeatures:)on iOS, or open them in an external browser view such as SFSafariViewController or Custom Tabs.
Receiving game events
The Iframe Events are only sent when the game runs inside an iframe. A game loaded directly in the WebView sends none. Events are optional — the game works fully without them.
To receive events in a native app, load a small page of your own in the WebView that iframes the launch URL and forwards the messages to your native code:
<iframe
id="game-iframe"
src="YOUR_GAME_SESSION_URL"
style="width: 100%; height: 100%; border: none;"
allow="autoplay"
></iframe>
<script>
window.addEventListener('message', (event) => {
if (event.data?.source !== 'marbles-game-widget') return
// iOS: a WKScriptMessageHandler you registered as "game"
window.webkit?.messageHandlers?.game?.postMessage(event.data)
// Android: an object you added with addJavascriptInterface(..., "GameBridge")
window.GameBridge?.postMessage(JSON.stringify(event.data))
})
</script>Commands such as refresh-balance are sent the usual way, with postMessage on the iframe from this page.
Inside an iframe the session cookie is third-party
This applies whenever the game sits in an iframe inside a WebView — your own wrapper page, or a casino web page that frames the game.
- Android: call
CookieManager.getInstance().setAcceptThirdPartyCookies(webView, true). - iOS: WKWebView blocks third-party cookies, so a reload of the game frame cannot restore the session. Request a fresh launch URL instead of reloading.
Checklist
- JavaScript and DOM storage enabled
- Inline media playback and autoplay allowed
- Standard user agent kept
- New-window links handled
- A fresh launch URL for every launch
lobbyUrl/depositUrlintercepted, or your own close button- For events: an iframe wrapper page, plus third-party cookies allowed on Android