Open DowsingUK opened 4 years ago
What disconnection are you referring? Are you referring to the SDK needing reauthorization or the card reader is disconnecting from Bluetooth at the same time every day?
The card reader is disconnecting from Bluetooth at the same time every day although I'm using RetailSDK.getDeviceManager().isConnectedToMiura() to check and reconnect
But so far it's not working after the disconnection isConnectedToMiura always return true
I really don't know why it would automatically disconnect every night at the same time unless there's something happening at that time which causes it to disconnect. If the reader is plugged into power, and connected within your app, then it shouldn't sleep at all even. However, if the app goes to sleep or something happens with the bluetooth on the iPad itself, then it could disconnect. For this, there's a disconnected listener that you can implement to be notified of said disconnections and then you can reconnect.
Last night I took a picture from what's happening so after that checking it just get disconnected so I think I found a solution every time I want to create a new transaction I check if device is connected using...
PaymentDevice activeDevice = RetailSDK.getDeviceManager().getActiveReader();
if(activeDevice != null && activeDevice.isConnected()) { beginPayment(); } else { reconnect(); }
Yes, that works, else you can use the disconnected listener and connect right away after disconnect as well.
Thank you good to know
I'm wondering why I get a disconnection every night at midnight timezone 0, I have tried different devices with different time zones but I always get a disconnection at the same time I haven't tried the Release SDK is this normal in the Debug SDK? should I expect the same behaviour in the Release SDK?