-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[connectivity] - add mobile network type to connection result #1945
Conversation
| return "none"; | ||
|
|
||
| switch (info.getSubtype()) { | ||
| case TelephonyManager.NETWORK_TYPE_1xRTT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a source for this info? How about a link to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i dont get you. Care to explain a bit more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How someone is supposed to know the mapping you did here? Do you have an http link that could be used as documentation for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to fully expose each type as a enum to dart. So we don't lose any information here. Same for iOS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed some updates. I added reference links for the mobile broadband speeds.
|
@cyanglaz sure. I will close the PR and merge this with his |
|
As discussed in #1727; we are going to work on this PR instead of that one. |
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Did a first round scan. Left some comments.
Basically I want to make 2 suggestions:
-
Could we keep the subtype more detailed by returning whatever we get from the platform, instead of translating them into different categories.
-
To avoid breaking change, let's keep the old API to just return the main type. And the new API to return the subtype.
...s/connectivity/android/src/main/java/io/flutter/plugins/connectivity/ConnectivityPlugin.java
Outdated
Show resolved
Hide resolved
| return "none"; | ||
|
|
||
| switch (info.getSubtype()) { | ||
| case TelephonyManager.NETWORK_TYPE_1xRTT: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to fully expose each type as a enum to dart. So we don't lose any information here. Same for iOS.
| /// | ||
| /// Instead listen for connectivity changes via [onConnectivityChanged] stream. | ||
| Future<ConnectivityResult> checkConnectivity() async { | ||
| Future<ConnectivityResult> checkConnectivity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkSubtype seems not used. Also add some doc to link to the [getNetworkSubtype] for people who wants to check the subtype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added some docs. Please review and let me know if they are up to standard.
| /// Return none if there is no connections | ||
| /// | ||
| /// Return unknown if it is connected but there is not connection subtype info. eg. Wifi | ||
| Future<ConnectionSubtype> getNetworkSubtype() async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more doc to point users to the [checkConnectivity] for who wants to check the main type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i added some docs. Please review and let me know if they are up to standard.
packages/connectivity/example/ios/Runner.xcodeproj/project.pbxproj
Outdated
Show resolved
Hide resolved
|
hi, any news? Best regards |
|
@bubunyo you can review? |
|
we can definitively able to merge? |
|
we need for this pull request. thanks |
|
+1 |
|
@cyanglaz why build-ipas fail? |
|
Seems there are some merge conflicts. |
|
I am trying to resolve the conflict but a lot of other things have been added, it will take some time to for me to get this working properly. |
|
any news? |
|
@bubunyo It was on hold since we were migrating plugins to a new Android embedding. Now that the migrating is done with connectivity, I can help with merging this PR in. There are some conflicts with this PR, could you rebase and resolve them first? |
|
Definitely, I can work on that tomorrow. |
Migrate the cloud_firestore core plugin to use the platform_interface package. All the "method channel" implementation now lives in the platform_interface package. The plugin is now ready to support federated implementations. Co-authored-by: David Iglesias <[email protected]> Co-authored-by: Collin Jackson <[email protected]>
|
Any update on this? Thanks |
|
Did someone still work on this useful feature ? Thk |
|
Still wanting so bad this feature on the official plugin |
|
Hello here, any news on this feature ? |
|
Connectivity 2.0.0 with breaking changes released and this is still not yet approved? |
|
We apologize for the long delay in following up on this PR. We’ve made the decision to no longer accept non-critical PRs for this plugin, as we hope that in time we’re able to transition users to the corresponding plugin in the Flutter Community Plus Plugins repository, so we encourage you to submit your PR there. I realize it's not ideal that this decision is happening after there has already had some initial review here, but hopefully that feedback will still be useful for a Flutter Community Plus Plugin version of the same change. We’re in the process of overhauling our PR triage system to respond much more quickly to avoid this kind of delay going forward. (Transitioning plugins like this one to the Flutter Community group is in fact part of that effort.) |
Description
Currently, the
ConnectionResultis an enum type with 3 values and no information on the type of mobile connection. With the PR, theConnectionResulttype is changed to anObjectwith two fields,typeandsubtypewith type retaining previousConnectionResultenum values and subtype providing information on the subtype of the connection if it is on mobile. (ie. EDGE, HSDPA and LTE.)Related Issues
fix for flutter/flutter#37618
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?