expo-sensors
Version:
Provides access to a hardware device's accelerometer, gyroscope, magnetometer, and pedometer.
20 lines (19 loc) • 839 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("expo/config-plugins");
const pkg = require('../../package.json');
const MOTION_USAGE = 'Allow $(PRODUCT_NAME) to access your device motion';
const withSensors = (config, { motionPermission } = {}) => {
if (motionPermission === false) {
config = (0, config_plugins_1.withPodfileProperties)(config, (config) => {
config.modResults.MOTION_PERMISSION = 'false';
return config;
});
}
return config_plugins_1.IOSConfig.Permissions.createPermissionsPlugin({
NSMotionUsageDescription: MOTION_USAGE,
})(config, {
NSMotionUsageDescription: motionPermission,
});
};
exports.default = (0, config_plugins_1.createRunOncePlugin)(withSensors, pkg.name, pkg.version);