Mobile integration

What the Swift app loads

The Swift app loads the Angular controller inside a WKWebView:

<https://jackpot-widget-webview.splash.tech/mobile>

This is the controller URL. It is not the operator backend URL and it is not the URL of the footer iframe.

The Jackpot SDK inside the controller creates the real widget iframe. Swift only loads the controller and exchanges messages with it.

The gear screen currently calls this value Widget URL. Use the complete controller URL ending in /mobile. You can also use a different HTTPS deployment of the same controller.

How startup works

  1. Swift opens the controller URL.
  2. Angular starts the native bridge.
  3. Angular sends controller.ready.
  4. Swift sends footer.launch with the footer data.
  5. Angular gives that data to the Jackpot SDK.
  6. The SDK creates the footer iframe.

Swift should wait for controller.ready before sending the first command. Sending it earlier can happen before Angular is listening.

Commands sent by Swift

The current app supports:

Command Data
footer.launch Complete footer response.
footer.updateData Complete updated footer response.
win.launch Complete win event data.
widgets.destroy No data.

The bridge adds the version and source to every command:

{
  "version": 1,
  "source": "splash-jackpot",
  "type": "footer.launch",
  "data": {}
}