sumup / sumup-ios-sdk

Other
46 stars 24 forks source link

Detecting if reader is connected to iOS #87

Open cuddeford opened 4 years ago

cuddeford commented 4 years ago

Our set up has our SumUp readers embedded into tables next to iPads. The iPads are customer facing and they pay for products with contactless alone because the readers are hidden.

Sometimes the readers have to be removed from the tables to charge or because they get permanently blocked (this happens a lot...). In these cases we have no way to inform our app that there is no connected device. We would like to disable the checkout button instead of exposing a device discovery and pairing modal.

Does the SDK have a method that exposes the reader connection status? Otherwise is there a way to access the underlying Bluetooth interface to achieve the same thing. As far as I've seen I would have to have the reader's unique UUID before I can request the status but any input from someone who knows more than I do would be greatly appreciated.

si458 commented 4 years ago

my testing of stuff today below: (developer myself)

  1. run checkoutWithRequest and its connects to the reader using BLE 4.0 (shows icon on reader)
  2. after transaction OR after failed transaction, returns to app with BLE icon still being shows on reader
  3. minimise ios app and load up external BLE scanner from app store
  4. connect to device inside BLE scanner app, you can then see information about the reader, etc...

so in theory you can run a BLE command to search devices and connect to the reader from inside your own app and if you connect to it successfully and can read information about it like version num, its ur reader thats connected to your device

i also tested this also by connecting the reader from my iphone, then doing a BLE scan from my macbook, found the reader, but was unsuccessful to connect to it from my macbook because it was already connected to my iphone

hope this helpful...