#Olly
1 messages ยท Page 1 of 1 (latest)
Hi there
Hmmm have you added some logs to ensure you are calling discoverReaders prior to attempting to connect?
Hi! I didn't expect a fast answer ๐ I'll provide u some logs about discovery from terminal and xcode a bit later. Thank you!
Sure
Can you show me your code for dicoverReaders and connecting?
Also what type of reader are you using?
Ah those logs have simulated reader
So you are using a bluetooth connection, correct?
correct
these are simulated, but same behaviour on real devices: I have BBPOS, M2 and WisePad 3
do you think it can be because I don cancel discovery before connecting to bluetoothreader?
Can you remove that from your connection flow and then test again?
ok
now this one
and also if I'm not adding that cancelDiscoverying looks like it stucks on discovery process because I'm using it in a react native modal
and every time I open modal and do discoverReaders it shows me that error
Was this working previously and then stopped working? Or you have just encountered this in the development process?
Also have you tried separating out your discovery from your connection?
Like you would discover on load
Then use a button or something to connect once you have successful discovery
I connect on tap one of the readers from list
that's right, whats was working now looks like it doesn't want to work
if is helpful for you I can send you my file/code
Hi there ๐ taking over, as my colleague needs to step away
Give me a few minutes to get caught up.
I connect on tap one of the readers from list
I don't know what this means.bismarckrecommended discovering readers on page load (e.g. when the page renders), then having a separate event likeonClick()to trigger the actually connect the reader. Have you tried that?
yes
I have an useEffect on discoverReaders process
and a separate function for connecting to reader
Okay, but is the function for connecting the reader triggered by another event?
since all of them are promises, I'm gonna move into separate functions that will await for every event call in here to remove any other bad practices
but the weirdest part is this was working.....
now it is late for me, but tomorrow morning I'll come up with a result