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

(ios) fixed no initial notification #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doug-a-brunner
Copy link

Platforms affected

  • iOS

Motivation and Context

On iOS, no batterystatus events are emitted until the battery level changes. This is a problem because an app should be able to find out what the battery level is without waiting an arbitrarily long time for it to change. (If a device stays plugged in and at 100%, it might never change at all.) Android, by comparison, emits immediately.

Description

Calls updateBatteryStatus every time start runs, so that new listeners get a value immediately.

Testing

Confirmed using that window.addEventListener('batterystatus', v => console.log(v); produces immediate output, which it did not do before the change. Also validated in our app.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@zabojad
Copy link

zabojad commented Feb 3, 2020

Any chance to get this merged soon?

@esskar
Copy link

esskar commented May 13, 2020

agreed; this should be merged asap.

@doug-a-brunner
Copy link
Author

Bump: can this be merged in soon?

@ShinZ6
Copy link

ShinZ6 commented Feb 8, 2021

Will this ever be merged?

@u01jmg3
Copy link

u01jmg3 commented Dec 16, 2021

@breautek, @erisu, @timbru31: sorry for the prompt but it would be great to get this PR merged. Or feedback on why it can't be. Thanks

@tbordinat
Copy link

Same here, would be great !

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

Successfully merging this pull request may close these issues.

7 participants