Skip Navigation

Registering JavaScript functions as Services in WebKit

Registering Your Service

  1. Add a dependency to the plug-in manifest file.

  2. Add a Service entry to the CFBundle entity within your redapp.xml file, as shown below.

<Service name="EMU_COMMAND" action_code="HOT"
status="" desc="">
<ExternalHandler target="" force_focus=ťfalseť/>

This sample registers the EMU_COMMAND service with the HOT command prefix for the action code. The handler represents a WebKit web app that is wrapped as a view. When registered service is triggered it will pass the json with Service Context to "process" function defined in redapp.xml file.

No callback function shall be defined in redapp.xml file. When service finishes processing it should call SrwCallback.callback() method with json Service Context as a parameter.