Skip to main content

App Feedback React Native API Reference

InitializationResult​

This class is used to hold the results of the initialization methods.

Kind: global class
Properties

NameTypeDescription
passedbooleanwhether or not initialization succeeded
surveyUrlstringinitialization message used to determine initialization status

TargetingResult​

This class is used to hold the results of the evaluation methods.

Kind: global class
Properties

NameTypeDescription
passedbooleanwhether or not target evaluation succeeded
surveyUrlstringlink to the survey in Creative where logic evaluation passed. url used to display survey in display()

Methods

recordClick() - void method()​

Records a click to the server associated with the Intercept.

Kind: instance method

recordImpression() - void method()​

Records an impression to the server associated with the Intercept.

Kind: instance method

initializeProject(brandid, projectid, [callback]) ⇒ initializationResults​

Initializes the Qualtrics singleton with the specified params.

Kind: global function
Returns: initializationResults - to the callback

ParamTypeDescription
brandidstringintercept brand id
projectidstringintercept project id
[callback]callbackoptional method called, if defined, to handle initializationResults

initializeProjectWithExtRefId(brandid, projectid, extrefid, [callback]) ⇒ initializationResults​

Initializes the Qualtrics singleton that is primed for XM Directory with specified params.

Kind: global function
Returns: initializationResults - to the callback

ParamTypeDescription
brandidstringintercept brand id
projectidstringintercept project id
[extrefid]stringoptional external reference id, if defined, to integrate with XMD
[callback]callbackoptional method called, if defined, to handle initializationResults

initialize(brandid, projectid, interceptid, [callback]) ⇒ InitializationResult​

Initializes the Qualtrics singleton with the specified params.

Kind: global function
Returns: InitializationResult - in callback
Deprecate: marked for future deprecation with version 2.0.0

ParamTypeDescription
brandidstringintercept brand id
projectidstringintercept project id
interceptidstringintercept id
[callback]callbackoptional method called, if defined, to handle the InitializationResult
Example​
import Qualtrics from 'react-native-qualtrics';

...
class App extends Component {
componentDidMount () {
Qualtrics.initialize('BRAND ID', 'PROJECT ID', 'INTERCEPT ID', (initializationResult) => {
if(initializationResult.passed) {
...
}
});
}
}
...

evaluateProject(callback) ⇒ TargetingResults​

Evaluates all the initialized Intercepts and calls callback.

Kind: global function
Returns: TargetingResults - in callback

ParamTypeDescription
callbackcallbackmethod called to handle TargetingResults, must be defined

evaluateIntercept(interceptId) ⇒ TargetingResults​

Evaluates the passed Intercept and calls callback.

Kind: global function
Returns: TargetingResults - in callback

ParamTypeDescription
interceptIdcallbackmethod called to handle TargetingResult, must be defined

evaluateTargetingLogic(callback) ⇒ TargetingResult​

Evaluates current Intercept and calls callback.

Kind: global function
Returns: TargetingResult - in callback
Deprecate: marked for future deprecation with version 2.0.0

ParamTypeDescription
callbackcallbackmethod called, to handle TargetingResult, must be defined
Example​
Qualtrics.evaluateTargetingLogic((targetingResult) => {
if (targetingResult.passed) {
...
}
});

display([autoCloseSurvey]) ⇒ Promise​

Displays a creative in the view controller. If a specific Intercept is being evaluated using evaluateIntercept, then displayIntercept must be used rather than display

Kind: global function
Returns: Promise - Promise object representing a bool

ParamTypeDescription
[autoCloseSurvey]booleanoptional flag for closing survey after finishing it
Example without autoCloseSurvey​
Qualtrics.evaluateTargetingLogic((targetingResult) => {
if (targetingResult.passed) {
var displayed = await Qualtrics.display()
}
});
Example with autoCloseSurvey​
Qualtrics.evaluateTargetingLogic((targetingResult) => {
if (targetingResult.passed) {
var displayed = await Qualtrics.display(true)
}
});

displayIntercept([autoCloseSurvey]) ⇒ Promise​

Displays a creative in the view controller.

Kind: global function
Returns: Promise - Promise object representing a bool

ParamTypeDescription
[autoCloseSurvey]booleanoptional flag for closing survey after finishing it

displayTarget([surveyUrl], [autoCloseSurvey])​

Displays evaluated TargetingResult in webview, or a provided URL target

Kind: global function

ParamTypeDescription
[surveyUrl]stringoptional URL to display in Qualtrics webview
[autoCloseSurvey]booleanoptional flag for closing survey after finishing it
Example with surveyUrl​
Qualtrics.evaluateTargetingLogic((targetingResult) => {
if (targetingResult.passed) {
Qualtrics.displayTarget(targetingResult.surveyUrl);
}
});
Example without surveyUrl​
Qualtrics.evaluateTargetingLogic((targetingResult) => {
if (targetingResult.passed) {
Qualtrics.displayTarget();
}
});

registerViewVisit(viewName)​

Records visits to a particular view.

Kind: global function

ParamTypeDescription
viewNamestringname of view to record
Example​
Qualtrics.registerViewVisit('VIEW NAME');

resetTimer()​

Resets timer used for Time Spent In App.

Kind: global function

Example​
Qualtrics.resetTimer();

resetViewCounter()​

Resets view count used for View Count.

Kind: global function

Example​
Qualtrics.resetViewCounter();

setString(propertyKey, propertyString)​

Sets string value for the specified key in properties.

Kind: global function

ParamTypeDescription
propertyKeystringKey for value
propertyStringstringString value to assign with key
Example​
Qualtrics.setString('firstName', 'John');

setNumber(propertyKey, propertyNumber)​

Sets double value for specified key in properties.

Kind: global function

ParamTypeDescription
propertyKeystringKey for value
propertyNumbernumberNumeric value to assign with key
Example​
Qualtrics.setNumber('age', 42);

setDateTime(propertyKey)​

Sets current datetime value for specified key in properties.

Kind: global function

ParamTypeDescription
propertyKeystringKey for value
Example​
Qualtrics.setDateTime('currentDate');

setNotificationIconAsset(propertyAsset)​

Sets string file name for notificationIconAsset in properties.

Kind: global function

ParamTypeDescription
propertyAssetstringFile name of Image stored in Drawable folder of Android Project
Example​
Qualtrics.setNotificationIconAsset("my_notification_icon");

setLastDisplayTimeForIntercept(interceptid) - void method()​

Sets the last displayed time of given intercept to the current time. Last display time is set automatically when display and displayIntercept functions are invoked but using other API (e.g. displayTarget) might require calling setLastDisplayedTime manually.

Kind: global function

ParamTypeDescription
interceptidstringThe ID of the intercept for which the last display time is being set
Qualtrics.setLastDisplayTimeForIntercept("interceptID");