airbridge-react-native-sdk
Version:
Airbridge SDK for React Native
59 lines • 1.78 kB
JavaScript
import { NativeModules } from 'react-native';
import { createInteractor } from '../architecture/Interactor';
export const createDependency = () => { };
createDependency.SwitchModule = () => ({
interactor: createInteractor(NativeModules.SwitchInteractor),
});
export const createSwitchModule = () => {
// create dependency
const { interactor } = createDependency.SwitchModule();
// define method
const enableSDK = () => {
interactor.enableSDK();
};
const disableSDK = () => {
interactor.disableSDK();
};
const isSDKEnabled = () => {
return interactor.isSDKEnabled();
};
const startTracking = () => {
interactor.startTracking();
};
const stopTracking = () => {
interactor.stopTracking();
};
const isTrackingEnabled = () => {
return interactor.isTrackingEnabled();
};
const startInAppPurchaseTracking = () => {
interactor.startInAppPurchaseTracking();
};
const stopInAppPurchaseTracking = () => {
interactor.stopInAppPurchaseTracking();
};
const isInAppPurchaseTrackingEnabled = () => {
return interactor.isInAppPurchaseTrackingEnabled();
};
const allowTrackingItem = (item) => {
interactor.allowTrackingItem(item.toString());
};
const blockTrackingItem = (item) => {
interactor.blockTrackingItem(item.toString());
};
// create object
return {
enableSDK,
disableSDK,
isSDKEnabled,
startTracking,
stopTracking,
isTrackingEnabled,
startInAppPurchaseTracking,
stopInAppPurchaseTracking,
isInAppPurchaseTrackingEnabled,
allowTrackingItem,
blockTrackingItem
};
};
//# sourceMappingURL=Switch.js.map