-
Notifications
You must be signed in to change notification settings - Fork 145
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
in iOs isn't working properly #78
Comments
Can you confirm that you see the same behaviour on a sample pure-cordova app (using no frameworks like ionic)? This will help us confirm that the issue is indeed with this plugin, and not something between else in between. Thanks. https://github.com/apache/cordova-contribute/blob/master/create-reproduction.md |
I can partially confirm it. iOS behaves like this: when you subscribe to the event, initially no update is triggered. only when the battery status changes (like battery drains or device is plugged in/out) the battery status update is fired. this is one pure-cordova app, ios 13. on device and simulator. looks like #77 adresses this problem. |
Here is a trick on how to immediately obtain current battery status on IOS:
Why unsubscribe forces to read the status ?
|
@u01jmg3 @platov @esskar @BerthaBrenes @breautek Instead of maintaining this plugin only for me, I published a new maintained plugin called "community-cordova-plugin-battery-status" (https://github.com/EYALIN/community-cordova-plugin-battery-status) which is maintained and will keep being. |
Bug Report
Problem
The plugging isn't working on iOS devices, the code haven't been update after 7 years
What is expected to happen?
Its suppose to show the battery status
What does actually happen?
Doesn't show anything, no even a simple console log in the function
Information
node v12.16.1
npm 6.13.4
ionic CLI 6.0.2
Command or Code
here my simple code
this.batteryStatus.onChange().subscribe(status => {
console.log("Estado Bateria");
console.log(status.level, status.isPlugged);
this.batteryText = status.level;
this.cdr.detectChanges();
});
Environment, Platform, Device
The text was updated successfully, but these errors were encountered: