injectPersoneticsWebview - React Native
React Native specific
Platforms:React Native
Description
injectPersoneticsWebview sends information to the webView.
Name | Type | Mandatory | Description |
---|---|---|---|
fromCall* | String | Yes | Type 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) + ');';
Name | Type | Mandatory | Description |
---|---|---|---|
webView | App’s WebView | Yes | Create a string with the function name and the data that was received. Inject the string into the WebView.if (webView) { webView.injectJavaScript(command); } |
data | Any params | Yes | The params that should be sent to the webView |
requestID | String | Yes | Is sent to the webView with the data. |
Return value
None
Updated 10 months ago