injectPersoneticsWebview - React Native

React Native specific

Platforms:React Native

Description
injectPersoneticsWebview sends information to the webView.

NameTypeMandatoryDescription
fromCall*StringYesType of call that was sent. Method of sending to WebView differs according to call type as described below.

*fromCall Examples

  • sendRequestToPServer – to be sent to handlePServerResponse
           ``personetics.handlePServerResponse(' +
            JSON.stringify(data) +
            ``, "${requestId}");```;\`
    
  • personeticsEvent– sent via personetics.startWidget
    command = ``'personetics.startWidget(' + data + ')';
  • sessionEnded – sent via startWidget. Data conversion is required.
    personetics.startWidget
    command = 'personetics.startWidget(' + data + ')'; command = 'personetics.startWidget(' + JSON.stringify(data) + ');';
NameTypeMandatoryDescription
webViewApp’s WebViewYesCreate a string with the function name and the data that was received. Inject the string into the WebView.
if (webView) { webView.injectJavaScript(command); }
dataAny paramsYesThe params that should be sent to the webView
requestIDStringYesIs sent to the webView with the data.

Return value
None