Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect at midnight? #179

Open
DowsingUK opened this issue Apr 28, 2020 · 7 comments
Open

Disconnect at midnight? #179

DowsingUK opened this issue Apr 28, 2020 · 7 comments

Comments

@DowsingUK
Copy link

DowsingUK commented Apr 28, 2020

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?

@ppmtscory
Copy link
Contributor

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?

@DowsingUK
Copy link
Author

The card reader is disconnecting from Bluetooth at the same time every day although I'm using RetailSDK.getDeviceManager().isConnectedToMiura() to check and reconnect

@DowsingUK
Copy link
Author

DowsingUK commented Apr 29, 2020

But so far it's not working after the disconnection isConnectedToMiura always return true

@ppmtscory
Copy link
Contributor

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.

@DowsingUK
Copy link
Author

DowsingUK commented Apr 29, 2020

IMG_2585
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();
}

@ppmtscory
Copy link
Contributor

Yes, that works, else you can use the disconnected listener and connect right away after disconnect as well.

@DowsingUK
Copy link
Author

Thank you good to know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants