UNPKG

react-native-unit-components

Version:

Unit React Native components

31 lines (30 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.useSnapshotProtection = void 0; var _reactNative = require("react-native"); var _UNSnapshotProtectionHelper = _interopRequireDefault(require("../nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper")); var _UnitComponentsSdkManager = require("../unitComponentsSdkManager/UnitComponentsSdkManager"); var _securitySettings = require("../types/shared/securitySettings"); var _react = require("react"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } const useSnapshotProtection = () => { /** * This hook provides snapshot protection specifically for Android. * For iOS, a native service is utilized instead. */ (0, _react.useEffect)(() => { if (!_UnitComponentsSdkManager.UnitComponentsSDK.isInitialized()) { return; } if (_UnitComponentsSdkManager.UnitComponentsSDK.getSecuritySettings().snapshotProtectionStrategy == _securitySettings.UNComponentsSnapshotProtectionStrategy.None) { return; } if (_reactNative.Platform.OS == 'android') { _UNSnapshotProtectionHelper.default.setAndroidSecurity(); } }, []); }; exports.useSnapshotProtection = useSnapshotProtection; //# sourceMappingURL=useSnapshotProtection.js.map