Dispatched when a command/response from a server-side extension is received.


- dataObj (Object)
- an object containing all the data sent by the server-side extension; by convention, a string property called _cmd should always be present, to distinguish between different responses coming from the same extension.
- type (String)
- one of the following response protocol types: XTMSG_TYPE_XML, XTMSG_TYPE_STR, XTMSG_TYPE_JSON. By default XTMSG_TYPE_XML is used.

Version:
SmartFoxServer Pro

The following example shows how to handle an extension response.
CopyC#

SFSEvent.onExtensionResponse += OnExtensionResponse; public void OnExtensionResponse(object data, string type) { // Handle XML responses if (type == SmartFoxClient.XTMSG_TYPE_XML) { SFSObject responseData = (SFSObject)data; // TODO: check command and perform required actions } // Handle RAW responses else if (type == SmartFoxClient.XTMSG_TYPE_STR) { string responseData = (string)data; // TODO: check command and perform required actions } // Handle JSON responses else if (type == SmartFoxClient.XTMSG_TYPE_JSON) { JsonData responseData = (JsonData)data; // TODO: check command and perform required actions } }
