#flodder

1 messages · Page 1 of 1 (latest)

covert jungleBOT
strong kernel
fallow geyser
#

You can - this is the guide I've been following

#

using RN

#

here you can specify simulated = true

strong kernel
strong kernel
#

You can see from the GH issue I linked we're adding support, so it's likely expected that there'll be issues

#

As this is a beta, I'd recommend filing any issues directly on the GH repo for the team to help with

fallow geyser
#

function DiscoverReadersScreen() {
const { discoverReaders, connectBluetoothReader, discoveredReaders } =
useStripeTerminal({
didUpdateDiscoveredReaders: (readers) => {
// After the SDK discovers a reader, your app can connect to it.
// Here, we're automatically connecting to the first discovered reader.
handleConnectBluetoothReader(readers[0].id);
},
});

useEffect(() => {
handleDiscoverReaders();
}, []);

const handleDiscoverReaders = async () => {
// The list of discovered readers is reported in the didUpdateDiscoveredReaders method
// within the useStripeTerminal hook.
const { error } = await discoverReaders({
discoveryMethod: 'bluetoothScan',
simulated: true,
});

if (error) {
  Alert.alert(
    'Discover readers error: ',
    `${error.code}, ${error.message}`
  );
}

};

const handleConnectBluetoothReader = async (id: string) => {
const { reader, error } = await connectBluetoothReader({
readerId: discoveredReaders[0].id,
// Since the simulated reader is not associated with a real location, we recommend
// specifying its existing mock location.
locationId: discoveredReaders[0].locationId,
});

if (error) {
  console.log('connectBluetoothReader error', error);
  return;
}

console.log('Reader connected successfully', reader);

};

return <View />;
}

#

this is the code directly from your guide

#

note:

#

const { error } = await discoverReaders({
discoveryMethod: 'bluetoothScan',
simulated: true,
});

strong kernel
#

Then I'd recommend filing an issue on the GH as stated. This is a beta SDK, and support is handled via that channel (we're not familiar with the SDK here yet)

fallow geyser
#

like I said, I have it fully working, but when I knock out the wifi and reconnect, it keeps giving me that SDK is not connected to the Internet error