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

Javascript API: Add ankiIsActiveNetworkMetered #6784

Merged
merged 1 commit into from
Aug 3, 2020

Conversation

david-allison
Copy link
Member

@david-allison david-allison commented Aug 1, 2020

Purpose / Description

Allows for deck developers to stop loading heavy assets such as videos on LTE

Fixes

Fixes #6783

Approach

Add relevant JS API

How Has This Been Tested?

Learning (optional, can help others)

This returns true for mobile data, can be true for WiFi as well if it's detected to be metered

Checklist

  • You have not changed whitespace unnecessarily (it makes diffs hard to read)
  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • Your code follows the style of the project (e.g. never omit braces in if statements)
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code

Allows for deck developers to stop loading heavy assets such as videos on LTE

Fixes 6783
@david-allison david-allison changed the title Javascript API: Add ankiIsCurrentNetworkMetered Javascript API: Add ankiIsActiveNetworkMetered Aug 1, 2020
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I help maintain react-native-netinfo so I've certainly seen these APIs before, looks right to me, with the compat as well etc

@mikehardy mikehardy merged commit 5bb0268 into ankidroid:master Aug 3, 2020
@mikehardy mikehardy added this to the 2.13 release milestone Aug 3, 2020
@david-allison david-allison deleted the 6783-api-is-metered branch September 7, 2020 23:23
lonewolf2208 pushed a commit to lonewolf2208/Anki-Android that referenced this pull request Sep 22, 2022
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.

Detecting Network Interface (WiFi/Mobile Data) from JS API
2 participants