You need to implement a single function we call in the WebView it will take a single object as a parameter.
window.receiveTRAction = function(action) {
switch (action.a){
case 'ExitApplication':
// Perform the exit function here.
break;
case 'OpenLink':
// Perform the open link here.
break;
case 'CreateAppointment':
// Perform creation of an appointment (Diary entry)
break;
case 'SendEmail':
// Start the creation of an email here
break;
case 'Navigate':
// Perform custom navigation.
break;
case 'ScanQRCode':
// A request to scan a QR code and return that value.
break;
case 'Share':
// A request to share a URL via the platforsm share facility.
break;
case 'Orientation':
// A request to change the orientation of the display.
break;
}
};
Below is a breakdown of each instruction and it’s parameters that will be sent to you.
Instructs the containing WebView to close teh application and navigate back as it would do in general.
This has no additional parameters.
Instructs the holding WebView to ask the local environment to open a url in a separate browser.
| Param | Description |
|---|---|
| url | The url to open in the external browser. |
Instructs the holding WebView to request the OS to perform the creation of a diary appointment.
| Param | Description |
|---|---|
| description | |
| start | Start date time. Date() |
| end | End date time. Date() |
Instructs the holding WebView to request the OS performs the creation of an email.
| Param | Description |
|---|---|
| description | |
| to | Destination email address. |
| subject | Subject line. |
| content | Optional content line for the email. |
This is a custom navigation instruction to your application to redirect the user to a place within.
| Param | Description |
|---|---|
| to | Primary navigation string. |
| argument | Custom parameter object with whatever you need to perform the navigation. |
This is a request for the device to scan a QR code and return the string value back to the application.
| Param | Description |
|---|---|
| reference | The reference for the return string so the application can tie it to the request. |
This is a request for the application to share a URL via teh sahre feature of the operating system.
| Param | Description |
|---|---|
| title | The title to use when shareing. |
| text | The text description for the share. |
| url | The URL to share. |
This is a request for the application to change the orientation of the phone.
| Param | Description |
|---|---|
| orientation | Either Landscape or Portrait. |