#ismailelric
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ismail-terminal-reactnative, 14 hours ago, 12 messages
Once you call connectXXXX function, I believe the discovery stops. If the connection process is interrupted and doesn't complete then you'd need to call discoverReaders again
as far as I remember
Okay. The issue is that if a reader is connected, other readers are no longer displayed as well. any idea how I can store discovered readers?
You could always store it in local storage, what's the usecase?
I intend on storing them in a state hook. however, the discoverReader only returns an error object
const discoverReaders: (params: DiscoverReadersParams) => Promise<{
error?: StripeError<CommonError>;
}>
I can use useMemo, but that is likely to cause unnecessary renders
After you call discoverReaders when readers get discovered, it should updated discoveredReaders array
https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=react-native&reader-type=bluetooth#discover-readers
useStripeTerminal({
didUpdateDiscoveredReaders: (readers) => {
// After the SDK discovers a reader, your app can connect to it.
},
});```
Yes, which happens to get cleared up when using connectXXX
didUpdateDiscoveredReaders is no longer available
how exactly are you attempting to store them before calling connectXXXX ?
I intend on storing them in a state hook. however, the discoverReader only returns an error object
do you meandiscoveredReadersinstead? Is there a typo in your code?
You are right. I want to store discoveredCardReaders.
The information you provided on this will do. Thank you.
Perfect