react-native-thermal-pos-printer
Version:
React Native thermal printer package for POS systems supporting Xprinter and other popular brands
14 lines (11 loc) • 535 B
text/typescript
import { PermissionsAndroid, Platform } from 'react-native';
export async function requestBluetoothPermissions(): Promise<boolean> {
if (Platform.OS !== 'android') return true;
const permissions = [
PermissionsAndroid.PERMISSIONS.BLUETOOTH_SCAN,
PermissionsAndroid.PERMISSIONS.BLUETOOTH_CONNECT,
PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
];
const results = await PermissionsAndroid.requestMultiple(permissions);
return Object.values(results).every(result => result === 'granted');
}