ground-android icon indicating copy to clipboard operation
ground-android copied to clipboard

[Capture location] Prompt for location permissions when capture location task is opened

Open shobhitagarwal1612 opened this issue 1 year ago • 15 comments

shobhitagarwal1612 avatar Aug 16 '24 15:08 shobhitagarwal1612

Capture location task may be replaced with "drop pin" task; we should get clarity on that before implementing this.

gino-m avatar Aug 21 '24 16:08 gino-m

As per @jo-spek we still need both capture location and drop pin as distinct tasks.

gino-m avatar Aug 22 '24 14:08 gino-m

@gino-m For Capture Location. Task, we have a location lock, so the permission dialog will always appear on the screen.

Do we need the same for Drop Pin & Draw or walk permiter?

anandwana001 avatar Aug 27 '24 10:08 anandwana001

The permissions should only be requested when needed: on "Drop pin" and "Walk perimeter" screens when the user taps the location lock, and immediately on the "Capture location" screen.

gino-m avatar Aug 27 '24 13:08 gino-m

ah, got it.

The current scenerio is,the permission dialog comes up at the first time, but if the user reject it, the location lock button is getting disabled by default and click is not working on it.

Let me check and raise a pr for this fix.

anandwana001 avatar Aug 27 '24 16:08 anandwana001

@gino-m if you could confirm the below user journey

Do we need to show the location permission if user moves back and forth? First time it is working fine.

https://github.com/user-attachments/assets/e377cb35-86aa-4598-9e6e-bd7ffa801758

anandwana001 avatar Aug 27 '24 17:08 anandwana001

For "capture location" tasks I would say yes. Rather than showing "Map location" on those tasks when location is disabled perhaps we want to say "Allow location sharing to continue?"

gino-m avatar Aug 27 '24 17:08 gino-m

@gino-m ok,

So, earlier we had kept the location button locked in the Capture Task, but now we have to keep to open so that user can click and get the permission dialog box, but if user disabled it keeping the device location enabled, we will not move forward.

Let me raise a PR for better understanding with user journey video

anandwana001 avatar Aug 29 '24 04:08 anandwana001

@kenstershiro The question here is how to handle the case when the user refuses access to location during the "capture location" data collection tasks. The first solution that comes to would be to show a modal dialog that doesn't let the user proceed until location permission is granted. To dialog could have two buttons, something like "Try again" or "Discard changes". The former would re-request permissions, the latter would close the data collection flow. Wdyt?

gino-m avatar Aug 29 '24 15:08 gino-m

@kenstershiro gentle reminder

anandwana001 avatar Sep 11 '24 07:09 anandwana001

@anandwana001 For now let's assume the user is directed to the dialog in #2635. If they say "no, don't leave survey", they'll be prompted for location permission again.

@amegantz Should we show custom text here to the dialog in this case do the tune of "If you don't grant location permission you can't continue to collect data for this site...." Buttons: "Exit" | "Try again"?

gino-m avatar Sep 25 '24 14:09 gino-m

https://github.com/user-attachments/assets/f825c5d1-5754-4927-8ff5-995389ef517e

anandwana001 avatar Oct 08 '24 08:10 anandwana001

@amegantz Should we show custom text here to the dialog in this case do the tune of "If you don't grant location permission you can't continue to collect data for this site...." Buttons: "Exit" | "Try again"?

@amegantz Gentle ping

gino-m avatar Oct 09 '24 14:10 gino-m

Sorry for the late response. How about this? Tried to connect it to the "Allow location" Android screen as much as possible.

Allow location sharing If you don't allow Ground to access this device’s location, you won’t be able to continue collecting data for this site. [Exit] [Allow location]

Image

amegantz avatar Oct 09 '24 18:10 amegantz

Back to you @anandwana001 !

gino-m avatar Oct 09 '24 19:10 gino-m

@anandwana001 we spoke @kenstershiro my suggestions to consider case of "optional" capture location tasks:

  • Show dialog when opening capture location task if permissions not already granted. Updated buttons to say "Cancel" or "Allow location"
  • If the user says "Cancel", return to task but disable "Capture" button.
  • Fix location lock button so that the user can tap it to re-request location permission.
  • If the task is required but they don't allow location their only option will be do exit by clicking the "x" in the top-left corner.

gino-m avatar Nov 04 '24 13:11 gino-m

@gino-m @anandwana001 sounds good to me

kenstershiro avatar Nov 06 '24 14:11 kenstershiro