Event Handler Functions

Introduction

The event handler functions determine the way Personetics widget communicates with the hosted application. The bank should implement each of the following callbacks according to the desired behavior.

Each callback sends a dedicated event to the bank’s app code, and is used by the bank to implement widget functionality. For example, when widget needs to send a network request to the Personetics server – the sendRequestToPserver event will be invoked.

The management of client delegate callbacks takes place within the handlePersoEvent function. This function is responsible for verifying the requestString in order to locate and execute the appropriate delegate callback.

Parameters

NameTypeMandatoryDescription
dataMapYesPersonetics Server Response. This aspect of property mapping encompasses both the requestString and json fields. The requestString serves as the identifier for locating the corresponding callback, while the json contains the specific data intended for use in the callback process.

Return value: None

Functions per Layout

Not all functions are relevant for all layouts, and some functions are layout specific. Below are the list of functions per layout.

Note the following:

  • Some of the functions have different parameters for different layouts; these are detailed in the relevant sections.
  • The parameter descriptions of the handlePserverResponse function are only informational. No configuration of the handlePserverResponse function is required.

Web Layout Functions

sendRequestToPServer 
sendRequestToEnrichServer 
sendRequestToOBServer
handlePServerResponse
navigateToPage 
widgetEvent
handleWidgetAction
sessionError
sessionEnded
handleError
sendRequestToPServer
sendRequestToEnrichServer
navigateToPage 
personeticsEvent
sessionEnded
Session Error
sendRequestToPServer
sendRequestToEnrichServer
navigateToPage
personeticsEvent
sessionEnded
Session Error

Mobile Layout Functions

Note the following:

In React Native, delegateCallback is referred to as a handleMessage function. This function handles callBack from the web. callBack includes an object which has a propertyRequest string which contains the ‘type’ to handle. The relevant types are described in this section.

sendRequestToPServer 
sendRequestToEnrichServer
handlePServerResponse (informational only)
personeticsEvent
handleWidgetAction
navigateToPage 
sessionError
sessionEnded
handleError
sendRequestToPServer 
sendRequestToEnrichServer 
handlePServerResponse (informational only)
personeticsEvent
goToPersoneticsWidget
handleWidgetAction
sessionError
sessionEnded
handleError
sendRequestToPServer 
sendRequestToEnrichServer 
navigateToPage 
personeticsEvent
sessionError
sessionEnded
injectPersoneticsWebview
void personeticsEvent(BuildContext context, obj) {
void sendRequestToPServer(requestBodyParams, context) async {
void navigateToPage(BuildContext context, obj) {
void sessionError(WebViewPlusController webView, obj)
void sessionEnded(BuildContext context, obj) 
void injectPersoneticsWebview(String fromCall, Map<String, dynamic> data, [requestId]