import { Platform } from 'react-native'; const ERROR_MESSAGE = 'This method is only available on Android because it is not supported on iOS'; export default () => { if (Platform.OS !== 'android') { throw new Error(ERROR_MESSAGE); } };