Skip Navigation

Registering JavaScript functions as Services in WebKit

Registering Your Service

  1. Add a dependency to the plug-in com.sabre.edge.cf.webapp.servicesto 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"
handler_name="com.sabre.edge.cf.webapp.services.WebViewForwardingService"
status="" desc="">
<ExternalHandler target="com.sabre.redapp.example.cf.webapp.services.view:process" force_focus=ťfalseť/>
</Service>

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.