Methods
checkEligibility(success, error)
Check to see if the user is eligible for a survey.
If the user meets trigger criteria *and* are in the sampling pool, the invitation is presented.
Implementers must explicitly check for eligibility (the SDK does not do this automatically).
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | A Cordova-style success callback object. |
error |
callback | A Cordova-style error callback object. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.checkEligibility(_onSuccess, _onFailure);`
customInviteAccepted(success, error)
Tells the SDK that a custom invitation was accepted.
You should call this method whenever a user accepts a custom invitation that you’ve presented.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.customInviteAccepted(_onSuccess, _onFailure);`
customInviteDeclined(success, error)
Tells the SDK that a custom invitation was declined.
You should call this method whenever a user declines a custom invitation that you’ve presented.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.customInviteDeclined(_onSuccess, _onFailure);`
getContactDetails(success, error)
Retrieves a user’s contact details.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the string with a user's contact details (it if was set). |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.getContactDetails(_onSuccess, _onFailure);`
getVersion(success, error)
Gets the version of the SDK
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message with the version of the SDK. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.getVersion(_onSuccess, _onFailure)`
incrementPageViews(success, error)
Manually increment the number of pages counted by the ForeSee SDK.
This can be useful when the user expected a new page to have been shown.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.incrementPageViews(_onSuccess, _onFailure);`
incrementSignificantEventCount(args, success, error)
Increment the significant event count for a given key.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | Array of string, we expect to get a single string inside. |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.incrementSignificantEventCount(["yourSignificantEventKey"], _onSuccess, _onFailure);`
isDebugLogEnabled(success, error)
Returns whether or not debug logging is enabled.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing Boolean value TRUE or FALSE. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.isDebugLogEnabled(_onSuccess, _onFailure)`
removeCPPValue(args, success, error)
Removes a CPP value.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | Array of string, we expect a single inside. |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.removeCPPValue(["customParam"], _onSuccess, _onFailure);`
removeInviteListener(success, error)
Remove the invite listener
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.removeInviteListener(_onSuccess, _onFailure);`
resetState(success, error)
Reset the state of the tracker.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command The callback takes one parameter, containing the message from a command |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.resetState(_onSuccess, _onFailure);`
setContactDetails(args, success, error)
Sets a user’s contact details. This method can be used to provide a user’s contact information, so that they do not need to enter it manually.
When provided, the default invite skips the user input screen. Only applies to CONTACT surveys.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.setContactDetails(["Bob"], _onSuccess, _onFailure);`
setCPPValue(args, success, error)
Sets a CPP key/value pair. CPPs are transmitted along with surveys upon submission.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | Array of parameters, we expect a key/value pair inside. Required by Cordova's plugin EXEC. |
success |
callback | A Cordova-style success callback object. |
error |
callback | A Cordova-style error callback object. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.setCPPValue(["customParam", "customValue"], _onSuccess, _onFailure);`
setDebugLogEnabled(args, success, error)
Sets whether or not to enable debug logging.
Debug logging prints useful state information to the console for inspection. By default, debug logging is disabled.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | array with one element; TRUE of FALSE. |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.setDebugLogEnabled(["true"], _onSuccess, _onFailure);`
setInviteListener(success, error)
Set the invite listener
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.setInviteListener(_onSuccess, _onFailure);`
setSkipPoolingCheck(args, success, error)
Disables the pooling check.
When debugging your implementation of the ForeSee SDK, it may be useful to disable the pooling check.
This ensures that the invitation will always shows if the loyalty criteria has been fulfilled.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | array with one element; TRUE of FALSE. |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.setSkipPoolingCheck(["true"], _onSuccess, _onFailure);`
showInvite(args, success, error)
Programmatically present the invitation for a given survey ID (sid).
Parameters:
Name | Type | Description |
---|---|---|
args |
array | Array of strings, we expect a surveyID inside. |
success |
callback | A Cordova-style success callback object. |
error |
callback | A Cordova-style error callback object. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.showInvite(["app_test_1"], _onSuccess, _onFailure);`
showSurvey(args, success, error)
Programmatically present the survey for a given survey ID (sid).
Parameters:
Name | Type | Description |
---|---|---|
args |
array | Array of strings, we expect a surveyID inside. |
success |
callback | A Cordova-style success callback object. |
error |
callback | A Cordova-style error callback object. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.showSurvey(["app_test_1"], _onSuccess, _onFailure);`
start(success, error)
Starts the CX Measure module.
Behavior of the two modules is defined in the foresee_configuration.json file.
Parameters:
Name | Type | Description |
---|---|---|
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.start(_onSucess, _onFailure)`
startWithConfigurationFile(args, success, error)
Starts the CX Measure module using a custom configuration file in your native project.
Behavior of the two modules is defined in the named configuration file in your project.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | array. The name of the configuration file to use when loading modules |
success |
callback | Callback that is invoked upon receiving the data about the invoked command The callback takes one parameter, containing the message from a command |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.startWithConfigurationFile(["my_config.json"], _onSuccess, _onFailure)`
startWithConfigurationJson(args, success, error)
Starts the CX Measure module using custom configuration JSON.
Behavior of the two modules is defined by the string provided.
Parameters:
Name | Type | Description |
---|---|---|
args |
array | array. The configuration string in JSON format to use when loading modules. |
success |
callback | Callback that is invoked upon receiving the data about the invoked command. The callback takes one parameter, containing the message from a command. |
error |
callback | Optional callback that is invoked in the event of an error. The callback takes one error parameter, containing the details of the error. |
- Source:
Example
`cordova.plugins.ForeSeeAPI.startWithConfigurationJson([jsonConfig], _onSuccess, _onFailure)`