Salesforce DMP ReactNative module.
npm install react-native-salesforce-dmp``bash`
npm install --save react-native-salesforce-dmp`bash`
react-native link react-native-salesforce-dmp
xml
`Usage
`js
// Import
import SalesforceDMP from 'react-native-salesforce-dmp';
`Implemented calls:
`js
/**
* Setup tracker
* @param {string} configId Configuration Id
* @param {boolean} debugFlag This outputs debug messages while it is trying to fetch data/send data
* to Salesforce DMP backend servers. You should turn this off before the final submission of
* your app.
* @return {promise}
*/
function setupTracker(configId, debugFlag) {
return RNSalesforceDMPModule.setupTracker(configId, debugFlag = false);
}/**
* Get segments
* @return {promise}
*/
function getSegments() {
return RNSalesforceDMPModule.getSegments();
}
/**
* Track page view
* @param {string} section Section name
* @param {Object.} pageAttributes An object with page attributes
* @param {Object.} userAttributes An object with user attributes
* @return {promise}
*/
function trackPageView(section, pageAttributes = {}, userAttributes = {}) {
return RNSalesforceDMPModule.trackPageView(section, pageAttributes, userAttributes);
}
/**
* Fire an event
* @param {string} event Event name
* @param {Object.} attributes An object with event attributes
* @return {promise}
*/
function fireEvent(event, attributes = {}) {
return RNSalesforceDMPModule.fireEvent(event, attributes);
}
/**
* Track a transaction
* @param {Object.} attributes An object with transaction attributes
* @return {promise}
*/
function trackTransaction(attributes = {}) {
return RNSalesforceDMPModule.trackTransaction(attributes);
}
/**
* Set consent
* @param {Object.} attributes An object with attributes
* @return {promise}
*/
function consentSetRequest(attributes) {
RNSalesforceDMPModule.consentSetRequest(attributes);
}
/**
* Get conset
* @param {Object.} attributes An object with attributes
* @return {promise}
*/
function consentGetRequest(attributes) {
RNSalesforceDMPModule.consentGetRequest(attributes);
}
/**
* Remove customer
* @param {Object.} attributes An object with attributes
* @return {promise}
*/
function consumerRemoveRequest(attributes) {
RNSalesforceDMPModule.consumerRemoveRequest(attributes);
}
/**
* Add consumer portability
* @param {Object.} attributes An object with attributes
* @return {promise}
*/
function consumerPortabilityRequest(attributes) {
RNSalesforceDMPModule.consumerPortabilityRequest(attributes);
}
``