You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In StripeTerminal v2.20.2 (and some earlier), when developing an iOS app using simulated, Bluetooth readers, the method Terminal.shared.disconnectReader will call its completion block without error, however Terminal is still connected to the simulated reader. When run on real hardware, the same code performs as expected.
thanks for the sample project that made it easy to reproduce 🙏
it seems the simulated reader implementation has an issue where it doesn't cleanup the connection status and connectedReader until after the completion block has run 😞. So if you put the checks
print("disconnectReader -- SUCCESS")
print("StripeTerminal status is \(self.describeTerminalStatus())")
print("StripeTerminal connected reader is \(Terminal.shared.connectedReader?.serialNumber ?? "<NONE>")")
print("Discovering readers again")
self.discoverReaders()
in a DispatchQueue.main.async {} it acts correctly. This of course shouldn't be needed though and is a bug. We'll get this fixed, likely for our 2.22.0 release. Thanks again for the report!
correct, it's a bug in the simulated reader. Disconnecting from a real Bluetooth reader should update the state to disconnected and a nil connectedReader when the disconnect completion is called.
Summary
In StripeTerminal v2.20.2 (and some earlier), when developing an iOS app using simulated, Bluetooth readers, the method Terminal.shared.disconnectReader will call its completion block without error, however Terminal is still connected to the simulated reader. When run on real hardware, the same code performs as expected.
Or am I missing something?
Code to reproduce
Here's a tiny app project that demonstrates the issue:
https://github.com/mikado2005/StripeDisconnect
iOS version
iOS 16.4.1
Installation method
Via Cocoapods
SDK version
2.20.2
Other information
The text was updated successfully, but these errors were encountered: