UNPKG

expo-sdcard-detector

Version:

Expo plugin to detect SD card storage paths on Android

19 lines (18 loc) 690 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExternalStoragePaths = getExternalStoragePaths; const react_native_1 = require("react-native"); const { SDCardDetector } = react_native_1.NativeModules; async function getExternalStoragePaths() { if (!SDCardDetector || typeof SDCardDetector.getExternalStoragePaths !== 'function') { return []; } try { const result = await SDCardDetector.getExternalStoragePaths(); return react_native_1.Platform.OS === 'android' ? JSON.parse(result) : []; } catch (error) { console.warn("Error retrieving external storage paths:", error); return []; } }