apache / cordova-plugin-network-information

Apache Cordova Network Information Plugin
https://cordova.apache.org/
Apache License 2.0
464 stars 321 forks source link

docs: Doc cleanup #116

Closed breautek closed 4 years ago

breautek commented 4 years ago

Platforms affected

none (docs update)

Motivation and Context

Removes obsolete documentation that no longer applies for variety of reasons.

Description

Testing

Checklist

PieterVanPoyer commented 4 years ago

In the issues, from time to time there are questions about events in the background. If I read the code, I think that ios stops dispatching events when the app is in the background. This is also true for the android setup.

https://github.com/apache/cordova-plugin-network-information/blob/9f8527062776ead04982d7fab12875a66bf69855/src/ios/CDVConnection.m#L135-L144

Maybe this should be mentioned in the Docs? It should solve/clarify issues like: https://github.com/apache/cordova-plugin-network-information/issues/102

Kind regards Pieter

breautek commented 4 years ago

@PieterVanPoyer Do you know if this only applies to the iOS platform? I know Android does allow javascript execution in the background unlike iOS (unless if this was changed in WKWebView... not 100% sure), although execution is throttled.

Basically wondering if it should be added as a general note or an "iOS Quirk".

PieterVanPoyer commented 4 years ago

Basically wondering if it should be added as a general note or an "iOS Quirk".

Can be added as a general note (for ios and android). In Android the javascript might execute, but the native broadcastreceiver is unregistered : https://github.com/apache/cordova-plugin-network-information/blob/9f8527062776ead04982d7fab12875a66bf69855/src/android/NetworkManager.java#L140-L143

So no change from network is detected.

breautek commented 4 years ago

Can be added as a general note (for ios and android).

I added it under a general Quirks section, although I guess this suggest it may apply to the other 2 supported platforms (browser and windows), which I'm not sure if this does apply to those platforms or not... Maybe I should repeat the same text in both an Android Quirks section and the iOS Quirks section?

PieterVanPoyer commented 4 years ago

It does also seem to be true for Windows. https://docs.microsoft.com/en-us/uwp/api/windows.networking.connectivity.networkstatuschangedeventhandler?view=winrt-19041 Events are received while the app is active. But I am no Windows expert. For the browser part I have no idea. I would leave it like a general comment like you did, but it might not be completely correct for all the browsers, although Chrome lately has a freezing feature https://www.google.com/amp/s/www.techradar.com/amp/news/chromes-new-feature-will-stop-tabs-from-eating-all-your-ram-heres-how-to-try-it Looks great to me!

breautek commented 4 years ago

I'll leave it as a general quirk rule then. Thanks for your help!