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

[$1000] [HOLD for payment 2024-07-24] [Feature] Improve 'location' permission flow with explainer and denied handling modals #37736

Closed
Julesssss opened this issue Mar 5, 2024 · 93 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Design Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2

Comments

@Julesssss
Copy link
Contributor

Julesssss commented Mar 5, 2024

Problem

Currently, we do not handle the case where users deny the location permission. This leads to a few problems on our mobile apps:

  • After requesting money, users are prompted for the location permission every single time which is confusing, invasive, and annoying
  • If the user denies this permission, we are restricted from asking them again
    • iOS: We cannot ask again after the first denial
    • Android: We cannot ask again after the 2nd denial
  • When restricted ^, we cannot deep link users to the permission settings page (on Android), we can only explain the actions they must take
  • The current flow looks like a bug as we are asking for the location permission after the user has left the Request Money flow
  • Android users who Scan a receipt, turn on location when requested, then accept the location permission remain stuck at the final step in the Request flow

GPS disabled, location permission disabled

iOS Android
E7A805B3-AF24-4C42-8954-48A25C4E8AFE Screenshot_20240305-114302

GPS enabled, location permission disabled

iOS Android
9CECE423-2AD8-4A9F-9505-629741B51406 Screenshot_20240305-113953

Full location flow (Android)

Untitled.mp4

Solution

The typical solution for mobile apps is to implement the following for permissions:

  1. We show a custom page/modal explaining why we are about to ask them to enable a permission and offering a choice(something like Okay or Cancel)
  2. If they tap Okay, we show them the native OS permission prompt
  3. If they tap 'Cancel', we do not show the native OS permission prompt
  4. If we are denied asking the user, show a custom modal explaining how they can manually allow the permission from the OS App settings

This better explains to users why we need the prompt, and prevents the need for the complicated 'Please navigate to App Settings > Permissions, and enable XYZ' instructions.


We have already implemented the above flow for the Camera permission. Let's build a similar flow for the location prompt. Here is the Camera flow:

x iOS Android
Explainer 87A5E029-E433-43EA-A576-BD65FEFE159B Screenshot_20240305-112003
Native OS prompt E4ED35A0-91E2-4409-9359-6DC526D31727 Screenshot_20240305-113921
Denied CC59EB0E-61E2-4596-A942-28A57242A9D9 Screenshot_20240305-112013

Proposed changes:

Pending @Expensify/design review

Location permission flow

  • When 'Request' button is pressed at the end of the Scan Receipt flow, check for location permission:
    • If granted, continue as normal
    • If not granted, show a modal that explains what/why we about to ask for the users location, and give two options: 'Okay, Cancel'
      • Okay: Show the native permission prompt, continue as normal
        • NOTE: The OS will show an additional modal here if GPS is not enabled
      • Cancel: Continue as normal, without users locations
    • If we are denied from asking, show a 'Denied' modal that explains how users can re-enable the permission manually
- GPS disabled, permission disabled, GPS prompt closed
- GPS disabled, permission disabled, modal closed
- GPS enabled, permission enabled, permission prompt closed
- GPS enabled, permission enabled, permission prompt rejected
- GPS enabled, permission enabled, permission prompt approved
- Permission prompt rejected (once iOS, twice Android), disabled modal accepted
- Permission prompt rejected (once iOS, twice Android), disabled modal rejected
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ae8e8fb606975e83
  • Upwork Job ID: 1764983541349486592
  • Last Price Increase: 2024-07-19
Issue OwnerCurrent Issue Owner: @
Issue OwnerCurrent Issue Owner: @zanyrenney
@Julesssss Julesssss added Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Design labels Mar 5, 2024
@Julesssss Julesssss self-assigned this Mar 5, 2024
Copy link

melvin-bot bot commented Mar 5, 2024

Job added to Upwork: https://www.upwork.com/jobs/~01ae8e8fb606975e83

Copy link

melvin-bot bot commented Mar 5, 2024

Triggered auto assignment to @dannymcclain (Design), see these Stack Overflow questions for more details.

Copy link

melvin-bot bot commented Mar 5, 2024

@melvin-bot melvin-bot bot added the Weekly KSv2 label Mar 5, 2024
@Expensify Expensify deleted a comment from melvin-bot bot Mar 5, 2024
@Expensify Expensify deleted a comment from melvin-bot bot Mar 5, 2024
@Julesssss
Copy link
Contributor Author

Hi @Expensify/design team. Please share your thoughts and suggestions!

  • One difference between the camera and location flow is that the camera explainer is displayed nicely within the in-page camera component, location doesn't have a similar in-page component so I assume we'd need to use a Modal instead?
  • Asking for the location permission every time the user scans a receipt can get quite annoying. What are your thoughts here? Should we stick with this for now, or explore alternatives like a timed delay?

@twisterdotcom
Copy link
Contributor

Asking for the location permission every time the user scans a receipt can get quite annoying. What are your thoughts here? Should we stick with this for now, or explore alternatives like a timed delay?

I agree, we don't do this in oldDot. I think we should ask once and if they choose "once" or "don't allow", we shouldn't ask again for SmartScan. (We can ask again for distance or anything else that may trigger it).

@Julesssss Julesssss changed the title [Feature] Implement denied 'location permission' flow [Feature] Improve 'location' permission flow with explainer and denied handling modals Mar 5, 2024
@dannymcclain
Copy link
Contributor

Definitely agree with the planned course of action here—very standard 👍

One difference between the camera and location flow is that the camera explainer is displayed nicely within the in-page camera component, location doesn't have a similar in-page component so I assume we'd need to use a Modal instead?

Yeah I'm thinking a modal will be best too. Definitely open to other ideas from the design team or anyone else.
When/where would that modal pop up?

Do we have any "bottom docked" modal patterns in NewDot that we could use for this? Might be nicer than a full page takeover (on desktop I imagine it's still just going to be a small, centered modal).

I agree, we don't do this in oldDot. I think we should ask once and if they choose "once" or "don't allow", we shouldn't ask again for SmartScan. (We can ask again for distance or anything else that may trigger it).

Yeah maybe we should ask once per type of flow? (scan, distance, etc.)

@shawnborton
Copy link
Contributor

Do we have any "bottom docked" modal patterns in NewDot that we could use for this?

Yup! It might be bottom-docked on mobile and then a centered modal on desktop for that pattern.

I agree with the general sentiment though - ask each time for location (assuming the user is tapping "My location"), and only ask once for SmartScan. We might consider re-asking after some time but we shouldn't ask every single time.

@dubielzyk-expensify
Copy link
Contributor

I share the opinions here. Smart to go with the soft ask to ensure we don't end up in a hard-block permissions territory.

I could go either on bottom sheet vs centered modal on mobile. I don't mind centered as it's also similar to the permission dialog itself, but don't feel remotely strongly.

A few dialog options from other apps:
image
image
image
image

@Julesssss
Copy link
Contributor Author

Excellent, thanks everyone. So the next step will be for the flow to be designed. @dannymcclain are you happy to do this?

It's not super high priority but it would be great to get this implemented (by a contributor) for the collect release. I believe we need the following:

  • Component UI for explainer location permission prompt
  • Component UI for declined location permission prompt
  • (optional) update to existing modal for declined camera permission
  • Copy and assets for the above

@rushatgabhane
Copy link
Member

rushatgabhane commented Mar 6, 2024

@Julesssss maybe you could add me back as C+ if this goes external.

Or, happy to implement it too!

@trjExpensify
Copy link
Contributor

trjExpensify commented Mar 6, 2024 via email

@dannymcclain
Copy link
Contributor

Sounds good to me! I'll share some stuff here once I've had a chance to work on it.

@dannymcclain
Copy link
Contributor

How about something like this? cc @Expensify/design

image

image

Note

Definitely need help with the copy.
For desktop, is it ok to throw a modal on top of another modal (RHP)?

@shawnborton
Copy link
Contributor

Nice, that's looking good! I think it's fine to have the modal on top of modal situation on desktop.

For the illustration, I wonder if there's something to be tried by adding a receipt into the mix somehow? Basically communicating that we want the location of the receipt as it helps with currency accuracy.

@dannymcclain
Copy link
Contributor

For the illustration, I wonder if there's something to be tried by adding a receipt into the mix somehow? Basically communicating that we want the location of the receipt as it helps with currency accuracy.

That's a good shout—any of these feeling closer?

image

@shawnborton
Copy link
Contributor

Nice! I like 1 and 3 here. The simplicity of 1 is quite nice, though you lose the cool earth. What are you feeling?

@garrettmknight
Copy link
Contributor

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Jul 17, 2024

@garrettmknight I think the offer should be $500 here as this was created before the April 6 deadline.

@Julesssss
Copy link
Contributor Author

We also need to discuss with @allroundexperts the price for this feature implementation. The scope was bigger than usual, and although the complication delays shouldn't be considered we agreed beforehand that this would be treated differently.

@allroundexperts
Copy link
Contributor

We also need to discuss with @allroundexperts the price for this feature implementation. The scope was bigger than usual, and although the complication delays shouldn't be considered we agreed beforehand that this would be treated differently.

@Julesssss I'm happy with anything above $500 😄

@Julesssss
Copy link
Contributor Author

Julesssss commented Jul 19, 2024

I'd say $1000 seems fair considering the amount of work necessary here. We also started this a few months back, when the default bounty was higher. Perhaps we should agree on that payment including a fix for this mWeb permission task.

Leaving this for a couple of days to see if anyone disagrees.

@garrettmknight garrettmknight changed the title [$250] [HOLD for payment 2024-07-24] [Feature] Improve 'location' permission flow with explainer and denied handling modals [$1000] [HOLD for payment 2024-07-24] [Feature] Improve 'location' permission flow with explainer and denied handling modals Jul 19, 2024
Copy link

melvin-bot bot commented Jul 19, 2024

Upwork job price has been updated to $1000

@melvin-bot melvin-bot bot added the Overdue label Jul 22, 2024
@Julesssss
Copy link
Contributor Author

Hi @allroundexperts. You may want to submit a proposal for this follow-up, considering you know the code well already.

@melvin-bot melvin-bot bot removed the Overdue label Jul 22, 2024
@shubham1206agra
Copy link
Contributor

Test steps

  1. Prompted for permission, prompt rejected
    Setup: Location permission ASK / Location feature OFF/ON
  • Create a money request from another user via the scan receipt flow
  • Submit it
  • In-app 'Allow location access' Modal should appear
  • Tap 'Not now'
  • The expense should submit without location data.
  1. Prompted for permission, prompt accepted, OS prompt rejected
    [iOS/Android/Web ONLY]
    Setup: Location permission ASK / Location feature ON
  • Create a money request from another user via the scan receipt flow and submit it
  • In-app 'Allow location access' Modal should appear
  • Tap 'Continue'
  • The OS permission prompt should appear

[iOS/Android ONLY from here on]

  • Reject it
  • Keep repeating the above steps and rejecting the OS permission prompt
    (1-3, THE NUMBER OF TIMES YOU NEED TO DECLINE DEPENDS ON OS)
  • Eventually the OS permission prompt will stop showing, instead our 'Allow location' modal should be displayed
  1. No modal appears
    Setup: Location permission ENABLED / Location feature ON
  • Create a money request from another user via the scan receipt flow
  • Submit it
  • No modals should appear, and the expense should submit with location data.
  1. No prompt permission, GPS prompt appears
    [iOS/Android ONLY]
    Setup: Location permission ENABLED / Location feature OFF
  • Create a money request from another user via the scan receipt flow
  • Submit it
  • You should be prompted to enable location/GPS
  • Select option (Settings option will open the settings page. Not now option will submit the expense without location)

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 labels Jul 23, 2024
@garrettmknight
Copy link
Contributor

garrettmknight commented Jul 24, 2024

New Upwork Job here

Payment Summary:

@garrettmknight garrettmknight removed their assignment Jul 24, 2024
@garrettmknight garrettmknight added NewFeature Something to build that is a new item. and removed NewFeature Something to build that is a new item. labels Jul 24, 2024
Copy link

melvin-bot bot commented Jul 24, 2024

Triggered auto assignment to @zanyrenney (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Jul 24, 2024
@garrettmknight
Copy link
Contributor

@zanyrenney I've created the QA - can you just make sure these two get paid while I'm OOO? Thanks!

@shubham1206agra
Copy link
Contributor

@zanyrenney @garrettmknight Accepted offer

@garrettmknight
Copy link
Contributor

Paid! Just waiting on @allroundexperts to request now

@allroundexperts
Copy link
Contributor

I've noted it down @garrettmknight. Feel free to close!

@Julesssss
Copy link
Contributor Author

I've noted it down @garrettmknight. Feel free to close!

@allroundexperts I was about to close this issue, but I'm not sure what you meant by 'I've noted it down'? Can I assume you have received payment?

@allroundexperts
Copy link
Contributor

I haven't received it yet. But I've added it to my tracker so even if its closed, I'd be able to still request the payment later on. I just do this to batch several payments together.

@Julesssss
Copy link
Contributor Author

Oh great, thanks for confirming.

@JmillsExpensify
Copy link

$1,000 approved for @allroundexperts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Design Internal Requires API changes or must be handled by Expensify staff NewFeature Something to build that is a new item. Weekly KSv2
Projects
No open projects
Archived in project
Development

No branches or pull requests