[Capture location] Prompt for location permissions when capture location task is opened
Capture location task may be replaced with "drop pin" task; we should get clarity on that before implementing this.
As per @jo-spek we still need both capture location and drop pin as distinct tasks.
@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?
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.
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.
@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
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 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
@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?
@kenstershiro gentle reminder
@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"?
https://github.com/user-attachments/assets/f825c5d1-5754-4927-8ff5-995389ef517e
@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
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]
Back to you @anandwana001 !
@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 @anandwana001 sounds good to me