Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-3489

Android: App cannot access geolocation if Location is disabled in the device

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.9.2
    • Fix Version/s: 3.9.3
    • Component/s: Android, Cordova
    • Labels:
    • Testing Instructions:
      Hide

      This issue needs to be tested both in iOS and Android devices.

      1. Open a screen containing a latitude/longitude database field input. Make sure to have location services turned off in the device and permissions not granted before (you can use a fresh installation if you are not sure).
      2. Click the button to obtain a location, it should ask you to grant permissions.

      In an Android device:

      1. The first time, deny the permissions request.
      2. You should see an error saying that permissions haven't been granted.
      3. Click the button again.
      4. You should see a new option in the permissions modal, saying "always deny" or something similar. This can differ from different Android versions, for example in Android 5.1 and below permissions are granted automatically.
      5. Grant permissions.
      6. A settings screen should open with a form to activate the location. Don't do it and go back to the app (using back may not work and you may need to change the process or click the moodle app icon again).
      7. You should see an error saying that location is not enabled.
      8. Click the button again.
      9. This time, activate the location. When you go back to the app, it should load a location into the fields.

      In an iOS device:

      1. Grant permissions.
      2. You should see an error saying that location is not enabled.
      3. Activate the location and click the button again. It should load a location into the fields.
      Show
      This issue needs to be tested both in iOS and Android devices. Open a screen containing a latitude/longitude database field input. Make sure to have location services turned off in the device and permissions not granted before (you can use a fresh installation if you are not sure). Click the button to obtain a location, it should ask you to grant permissions. In an Android device: The first time, deny the permissions request. You should see an error saying that permissions haven't been granted. Click the button again. You should see a new option in the permissions modal, saying "always deny" or something similar. This can differ from different Android versions, for example in Android 5.1 and below permissions are granted automatically. Grant permissions. A settings screen should open with a form to activate the location. Don't do it and go back to the app (using back may not work and you may need to change the process or click the moodle app icon again). You should see an error saying that location is not enabled. Click the button again. This time, activate the location. When you go back to the app, it should load a location into the fields. In an iOS device: Grant permissions. You should see an error saying that location is not enabled. Activate the location and click the button again. It should load a location into the fields.
    • Affected Branches:
      MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_39_STABLE
    • Pull Master Branch:
    • Sprint:
      Moodle App 3.9.3

      Description

      If a user has Location disabled in the device and uses the Geolocation feature of the app, it will display a spinner for 30 seconds and then display a timeout error.

      There are a couple of issues in the cordova plugin related to this. In one issue they ask for the plugin to be able to detect and change the Location setting, but the plugin maintainer says it's out of the scope for the plugin.

      In another issue, a user is using other plugins to achieve that: Diagnostic and Location Accuracy. Maybe we should use those plugins too, or see if there are others that match our needs.

        Attachments

          Activity

            People

            Assignee:
            noeldemartin Noel De Martin
            Reporter:
            dpalou Dani Palou
            Peer reviewer:
            Dani Palou
            Integrator:
            Juan Leyva
            Tester:
            Isabel Renedo Rouco
            Participants:
            Component watchers:
            Juan Leyva
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              30/Nov/20