UNPKG

airbridge-react-native-sdk

Version:

Airbridge SDK for React Native

51 lines 1.52 kB
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.isSDKEnabled(); }; const startInAppPurchaseTracking = () => { interactor.startInAppPurchaseTracking(); }; const stopInAppPurchaseTracking = () => { interactor.stopInAppPurchaseTracking(); }; const isInAppPurchaseTrackingEnabled = () => { return interactor.isInAppPurchaseTrackingEnabled(); }; // create object return { enableSDK, disableSDK, isSDKEnabled, startTracking, stopTracking, isTrackingEnabled, startInAppPurchaseTracking, stopInAppPurchaseTracking, isInAppPurchaseTrackingEnabled, }; }; //# sourceMappingURL=Switch.js.map