stripe / stripe-terminal-android

Stripe Terminal Android SDK
https://stripe.dev/stripe-terminal-android/
Other
94 stars 46 forks source link

The battery level obtained from Stripe M2 connectedReader.getBatteryLevel() is incorrect. #423

Closed OliverYang0305 closed 6 months ago

OliverYang0305 commented 9 months ago

Summary

The battery level obtained from Stripe M2 connectedReader.getBatteryLevel() is incorrect. Our application actively queries the battery level of the M2 device. The result obtained is 60%, but in reality, it is 100%. This continuous prompting for charging has caused some inconvenience to customers.

The log is as follows.

image

Code to reproduce

Reader connectedReader = Terminal.getInstance().getConnectedReader(); if (connectedReader == null) { return 0; } Float batteryLevelF = connectedReader.getBatteryLevel(); if (batteryLevelF == null) { return 0; } float nowBattery = batteryLevelF * 100;

Android version

Android 9.

Impacted devices (Android devices or readers)

Stripe M2 SN: STRM26229025856

SDK version

com.stripe:stripeterminal:3.0.0-b6

Other information

bperez-stripe commented 9 months ago

Hi @OliverYang0305. Are you able to reproduce this with the latest SDK release?

OliverYang0305 commented 9 months ago

@bperez-stripe Hi, I tested on version 3.3.0, and the problem still exists. The return value of connectedReader.getBatteryLevel() seems to always be the battery level at the time of connection.

udayTechnosouls commented 9 months ago

I got same issue like seems to always be the battery level at the time of connection. I have set timer and every 5 mit checking Battery Level code : Terminal.getInstance().connectedReader?.batteryLevel?.times(100) ?: 0.0F Where else I can found Battery Level or How I can refresh Battery Level ?

chr-stripe commented 6 months ago

Hi all! With the release of Terminal SDK 3.6.0, Terminal.connectedReader's battery level will now be updated whenever the mobile reader's battery info is reported.