WebView WebGL Integration

Section 5.5

This section helps understand how to implement a WebView in an Android or iOS application that can host an embedded TableRealms application.

Web View can be implemented in Native Android or iOS as well as in ReactNative.

Understanding the Integration

To integrate completely some aspect are common and some might be specific to your Table Realms application’s needs. This document covers the basics and specifics such as alternative authentication mechanics or navigation back into your application options will need to be decided upon and designed for your application specifically. There is no common way but the system does allow for flexibility in integration’s like that.

The following things need to bee achieved.

  • Load the TR application
  • Ember your own javascript into the page for communication between Table Realms and your application
  • Trigger the Table Realms application to start.

Getting Started

You will need to have an existing hosted Table Realms application to test with.

TODO: Building a suitable harness testing application.

Step 1. Load the Table Realms application into your WebView

Create your WebView and point it’s URL to the application. This could be a custom application you are integration or a test application.

This will load the application but since we are in a web view the application will hold and not load completely without an instruction from you. This is needed so that application doesn’t try call methods you have not yet installed into the WebView.

Step 2. Implement the callbacks into the JavaScript of the page

In order to communicate between the Table Realms application and your application we use html events. You do not need to implement all the events in order for things to work, we just need to make sure that the events your Table Realms application needs are done. Below is a table of the events what they do and if they are required or optional.

Messages from Table Realms to your application

In order for us to pass you messages you need to add a function to the webview we can call with a single object payload. The link above breaks that down further.

Message Description Required
ExitApplication Instructs the containing WebView to close teh application and navigate back as it would do in general. Yes
OpenLink Instructs the holding WebView to ask the local environment to open a url in a separate browser. No
CreateAppointment Instructs the holding WebView to request the OS to perform the creation of a diary appointment. No
SendEmail Instructs the holding WebView to request the OS performs the creation of an email. No
Navigate This is a custom navigation instruction to your application to redirect the user to a place within. No

Messages from your application to TableRealms

Message Description Required
window.tableRealmsInit() This starts the Table Realms application (see Step 3) Yes
window.receiveAction(action) This is where you can send actions to TableRealms. No

Step 3. Tell Table Realms application to start

Once you have embedded your events into the HTML page you need to instruct Table Realms to launch the application. this is done to prevent the application from attempting to use embedded functions before you have added them to the page.

Add the following code to the page

window.tableRealmsInit();