How to dedect when PS20J is removed from cradle

E Efkan YILMAZ 1 year 11 months ago
49 0 0

How to discover when PS20J personal shopper is taken from smart cradle when cradle is unlocked?
Enterprise Browser 2 is used in Android 8.
I tried
<code>
const unlockparam = {
"ledOnDuration": 1000,
"ledOffDuration": 1000,
"timeout": 10,
"smoothingEffect": true
};
EB.SmartCradle.unlockEx(unlockparam, function () {
console.write('Device is taken from Cradle');
});
</code>
but callback fires immediately after unlocking, not after device is taken. How to detect device detach from cradle. I tried to poll for cradle property using
<code>
EB.SmartCradle.getProperty("wallId") !== 0
</code>
but it returns value even after PS20 is removed from cradle.
Getting device from cradle stops charging. Is it possible/reasonable to check charging state to dedect removal using API like https://developer.mozilla.org/en-US/docs/Web/API/Battery_Status_API?

CONTACT
Can’t find what you’re looking for?