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

Bug: connectivity module always return undefined on android <= 4.4 #3098

Closed
m-abs opened this issue Nov 15, 2016 · 5 comments · Fixed by #3105
Closed

Bug: connectivity module always return undefined on android <= 4.4 #3098

m-abs opened this issue Nov 15, 2016 · 5 comments · Fixed by #3105
Assignees
Projects
Milestone

Comments

@m-abs
Copy link
Contributor

m-abs commented Nov 15, 2016

Which platform(s) does your issue occur on?

Android <= 4.4 (Tested on 4.2.2 and 4.4.2 with emulator)
Android >= 5.0 works as expected (at least all the versions I've tested on)

Please provide the following version numbers that your issue occurs with:

  • CLI: 2.3.0
  • Cross-platform modules: 2.3.0
  • Runtime(s): tns-android@2.3.0
  • Plugin(s):

Please tell us how to recreate the issue in as much detail as possible.

*Steps to reproduce: *

  • Setup a project, enable android.permission.ACCESS_NETWORK_STATE in app/App_Resources/Android/AndroidManifest.xml
  • Import the connectivity module;
  • Setup and connectivity.startMonitoring or call connectivity.getConnectionType()
  • On older androids (I tested on an emulator running 4.2.2 and 4.4.2, CPU: Google APIs Intel Atom x86) connectivity status is always undefined.

Expected result:
Connection status on both older and newer android.

Is there code involved? If so, please share the minimal amount of code needed to recreate the

problem.

I've made a simple example here:
https://github.com/m-abs/ns-debugging/tree/connectivity-issue

    connectivity.startMonitoring((status) => {
      console.log(status);
      switch (status) {
        case connectivity.connectionType.mobile: {
          this.networkStatus = 'MOBILE';
          break;
        }
        case connectivity.connectionType.wifi: {
          this.networkStatus = 'WIFI';
          break;
        }
        case connectivity.connectionType.none: {
          this.networkStatus = 'OFFLINE';
          break;
        }
        default: {
          this.networkStatus = 'UNKNOWN';
          break;
        }
      }
    });
@tsonevn tsonevn self-assigned this Nov 15, 2016
@tsonevn
Copy link
Contributor

tsonevn commented Nov 15, 2016

Hi @m-abs,
Thank you for reporting this issue and for providing sample project.

I was able to reproduce this behavior on emulator with API level 18 and 17. Regarding to that I could not reproduce this problem on real device. We will research further this issue and will provide additional information. In the mean time could you check, whether you will reproduce this problem on real device?

Regards,
@tsonevn

@hamorphis hamorphis self-assigned this Nov 15, 2016
@m-abs
Copy link
Contributor Author

m-abs commented Nov 15, 2016

I'll have to get back to you, when I've found a hardware device with older android version.

@m-abs
Copy link
Contributor Author

m-abs commented Nov 16, 2016

Hi @tsonevn
Sorry, I can't test on a real device with Android4.2/API17, the oldest device I've access to right now runs Android 4.4.

But if the problem only occures on an emulator it's only a minor annoyance for us.

@hamorphis
Copy link
Contributor

@m-abs The bug has been fixed: #3105

@hamorphis hamorphis added this to the 2.5.0 milestone Nov 17, 2016
@lock
Copy link

lock bot commented Aug 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
2.5
Done
Development

Successfully merging a pull request may close this issue.

3 participants