Skip to content

Property enableBluetooth of null #29

@elvispdosreis

Description

@elvispdosreis

I am having difficulty running the project using npx expo start

my version of react-native doesn't support it
react-native link tp-react-native-bluetooth-printer

Imagem do WhatsApp de 2024-02-22 à(s) 14 06 58_28b60f40

return (
    <View style={styles.container}>
        <Button
            title="Press mex"
            onPress={() => BluetoothManager.enableBluetooth().then(
                (r) => {
                    const paired = [];
                    if (r && r.length > 0) {
                        for (let i = 0; i < r.length; i++) {
                            try {
                                paired.push(JSON.parse(r[i])); // NEED TO PARSE THE DEVICE INFORMATION
                            } catch (e) {
                                //ignore
                            }
                        }
                    }
                    console.log(JSON.stringify(paired));
                },
                (err) => {
                    alert(err);
                }
            )}
        />
    </View>
  );


"dependencies": {
    "expo": "~50.0.6",
    "expo-status-bar": "~1.11.1",
    "react": "18.2.0",
    "react-native": "0.73.4",
    "tp-react-native-bluetooth-printer": "^1.5.0"
  }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions