Retrieving an Interaction response

The Medallia Experience Orchestration Cordova SDK considers iOS View Controllers and Android Activities and/or Fragments as Interactions. When configured correctly the SDK will automatically send an Interaction request to Medallia Experience Orchestration and process the response which may contain Points (Optimizations, Capture, etc). If desired, you can be notified of these automatic Interactions to take additional action on each Interaction request, by using the automatic Interaction callback API.

It is incumbent on you to then process the response in order for the Medallia Experience Orchestration Cordova SDK to perform automatic Capture and Optimization.

Important: Assigning a manual/custom Interaction to a view should be done before setting an automatic Interaction callback. If you set a callback for an automatically triggered Interaction, remove that callback as soon as it is no longer needed.

The response can be passed to the processResponse method, as shown below. By calling this method the response is returned to the SDK to process, attaching any Captures, Trackers, and/or Optimizations to the Interaction.

For retrieving the response in sending programmatic Interactions, see sending an Interaction request and retrieve the response.

const interactionRequest = {
	interaction: 'cordova://app-test/interaction1',
    	properties: {
      		key1: 'value1',
      		key2: 'value2'
	}
}
MedalliaMXO.sendInteraction(interactionRequest).then((response) => {
	// do something with the response
	// process response
	return MedalliaMXO.processResponse(response)
})
.catch((error) => {
	// do something with the error
	console.error(error)
})