Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0
    • Fix Version/s: 1.5.0
    • Component/s: Android
    • Labels:
      None

      Description

      navigator.network.connection.type returns 'unknown' when the device is just started. When you change the network type (for example when you turn Wifi on and off) the type is correct. But if a user never does this it keeps returning 'unknown'.

      We use this to detect if data can be sent or not, and when it returns 'unknown' it's possible that there is a connection, but it's possible that there isn't one too. We can't know which one it is.

      This happens with PhoneGap 1.4.1 on Android 2.2.2 and 2.3.3, on iOS it seems to be correct.

        Activity

        Hide
        Simon MacDonald added a comment -

        Can you confirm that you have the following permissions in your AndroidManifest.xml?

        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

        Show
        Simon MacDonald added a comment - Can you confirm that you have the following permissions in your AndroidManifest.xml? <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        Hide
        Jolien Coenraets added a comment -

        Hi,

        We don't request the Wifi state permission. Can this be the problem? We thought that network state was enough. I will give it a try to see if this fixes this bug, but it I think it will not be before Monday.

        Thanks for your reply

        Show
        Jolien Coenraets added a comment - Hi, We don't request the Wifi state permission. Can this be the problem? We thought that network state was enough. I will give it a try to see if this fixes this bug, but it I think it will not be before Monday. Thanks for your reply
        Hide
        Jolien Coenraets added a comment -

        Hi,

        I added the Wifi state permission but that doesn't change the problem. You can simulate the problem by restarting your phone and then ask the connection type (without changing it after the start up of your phone).

        Show
        Jolien Coenraets added a comment - Hi, I added the Wifi state permission but that doesn't change the problem. You can simulate the problem by restarting your phone and then ask the connection type (without changing it after the start up of your phone).
        Hide
        Joe Bowser added a comment -

        This is related to the cordova-js work that you are currently doing.

        Show
        Joe Bowser added a comment - This is related to the cordova-js work that you are currently doing.
        Hide
        Joe Bowser added a comment -

        This was fixed in 1.5

        Show
        Joe Bowser added a comment - This was fixed in 1.5

          People

          • Assignee:
            Simon MacDonald
            Reporter:
            Jolien Coenraets
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development