@logicwind/react-native-fold-detection
Version:
The purpose of the package is to provide details regarding the Android folding capability.
30 lines (29 loc) • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
exports.startFoldEventListener = startFoldEventListener;
exports.stopFoldEventListener = stopFoldEventListener;
var _reactNative = require("react-native");
const LINKING_ERROR = `The package 'react-native-folding-feature' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
const FoldingFeature = _reactNative.Platform.OS === 'ios' ? null : _reactNative.NativeModules.FoldingFeature ? _reactNative.NativeModules.FoldingFeature : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
function startFoldEventListener() {
if (_reactNative.Platform.OS === 'android') {
FoldingFeature.startListening();
}
}
function stopFoldEventListener() {
if (_reactNative.Platform.OS === 'android') {
FoldingFeature.stopListening();
}
}
var _default = exports.default = FoldingFeature;
//# sourceMappingURL=FoldingFeature.js.map