Skip to content

Nearby Tab Accessible Without Location Permission #3732

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

Closed
nathanmeade opened this issue May 5, 2020 · 31 comments · Fixed by #4259 or #4771
Closed

Nearby Tab Accessible Without Location Permission #3732

nathanmeade opened this issue May 5, 2020 · 31 comments · Fixed by #4259 or #4771
Assignees

Comments

@nathanmeade
Copy link

Summary:
When the user has not granted permission for location, the nearby tab can still be accessed when performing the appropriate steps - displaying the nearby tab and map without any results. To prevent the displaying of the nearby tab without any results in this case, the edge cases that allow for the user selecting the nearby tab without the location permission (no location data) need to be fixed.

This issue was discovered when attempting to reproduce the blank nearby list issue (#3727) @neslihanturan

Steps to reproduce:

  1. Make sure the app does not have the location permission
  2. While logged in, select the "Nearby" tab of the "Home" screen
  3. Deny the access to location
  4. Select "No" to the permission request dialog
  5. Select the "Nearby" tab again
  6. Tap away from the dialog to make it disappear
  7. Observe that there are no results

Screen-shots:
No results map screenshot:
nearbyNoResultsMapScreenshot

No results list screenshot:
nearbyNoResultsListScreenshot

Would you like to work on the issue?

I would like to work on this issue.

@neslihanturan
Copy link
Collaborator

Yes @nathanmeade , you understood the issue right. User should never see this empty map at all.

@gerardolgvr
Copy link

Hello! Is this fixed?

I was thinking about some possible solutions to this problem:

Let me know your thoughts, have a nice day

@neslihanturan
Copy link
Collaborator

Thank you for suggestions @gerardolgvr , the issue is still not fixed. You can work on this one. I think ideal solution is sending the user back to contributons fragment when permission is not given.

@gerardolgvr
Copy link

gerardolgvr commented Jun 11, 2020

oh yeah, sounds a great idea @neslihanturan

Thanks

@nathanmeade
Copy link
Author

@neslihanturan @gerardolgvr I have not been able to get to this fix yet. Feel free to reassign this as you see fit.

@Anyrob
Copy link

Anyrob commented Jun 12, 2020

Hi! I would like to take it if you don't mind, I already have thought a solution, just waiting for you, to give me green light :) @neslihanturan @gerardolgvr

@neslihanturan
Copy link
Collaborator

Please go for it @Anyrob :)

@neslihanturan
Copy link
Collaborator

neslihanturan commented Jun 12, 2020

Thank you @nathanmeade for your time and reporting your unavailabilit :)

@Anyrob
Copy link

Anyrob commented Jun 12, 2020

Thank you!! @neslihanturan

@gerardolgvr
Copy link

Go ahead @Anyrob ! :D

Anyrob pushed a commit to Anyrob/apps-android-commons that referenced this issue Jun 16, 2020
@Anyrob
Copy link

Anyrob commented Jul 2, 2020

Hi, @neslihanturan! I was wondering if you have had a chance to check my pull request. This time, I was trying to add some test but I ran into a lot of problems since other tests are broken even though I try different ways (even with espresso which also helped me discover another bug in the application) I did not find a way to perform the test in any way other than manual, do you have any recommendations for me?

@sivaraam
Copy link
Member

sivaraam commented Jul 2, 2020

I think ideal solution is sending the user back to contributons fragment when permission is not given.

I doubt whether that's an ideal solution given that we have a "Search this area" feature. I wonder why there should be a hard requirement on the location permission when Nearby could be used to browse places even without the location permission, as I understand it. 🤔

@misaochan
Copy link
Member

I wonder why there should be a hard requirement on the location permission when Nearby could be used to browse places even without the location permission, as I understand it

I'm not sure if the Mapbox SDK itself requires location permissions to function, but if it doesn't, that could be a possibility. However, which section of the globe should we display initially to the user if we don't know where they are? ;)

@sivaraam
Copy link
Member

sivaraam commented Jul 3, 2020

I'm not sure if the Mapbox SDK itself requires location permissions to function, but if it doesn't, that could be a possibility.

Sounds great!

However, which section of the globe should we display initially to the user if we don't know where they are? ;)

I think we already know the answer to that, "Tower of London":
Screenshot_2020-07-03-23-07-47

This is location that the app shows now before it gets the actual location of the user (i.e. when the GPS is turned off, GPS is triangulating user's location etc.). Alternatively, we could follow what the Wikipedia app did in this case when it had the Nearby feature ;-). To the best of my memory, it showed the zoomed-out globe view in these cases.

@Pratham2305
Copy link
Contributor

Hi! I would like to work on this.
I agree with @sivaraam, I think we can initially show a zoomed out map and if the user allows the permission then we can zoom to the user's location otherwise, we can still enable the "search this area" button and allow the user to use it and upload images.

@misaochan
Copy link
Member

Hi @Pratham2305 , sorry for the slow response! Are you still interested in working on this?

I agree with you and @sivaraam , the "search this area" button should be allowed regardless, and pins should still be loaded. For the initial area to display, I'm OK with either a zoomed out view, or a random location, or even the Tower of London ;). But if we go with a zoomed out view, we do have a limit on the number of pins that can be loaded, so we will not be able to display all the pins in a zoomed out area.

Also, I just realized that #4198 is a duplicate of the discussion here, so I will close that.

@Pratham2305
Copy link
Contributor

@misaochan Yes, I would love to work on this one.

@misaochan
Copy link
Member

@Pratham2305 It is yours. :) Please keep us updated on your progress.

nicolas-raoul pushed a commit that referenced this issue Feb 26, 2021
* Added ability to access nearby tab without location permissions

* added ability to remember user choice if the permission is denied.

* fixed the issue with permission dialog box in contribution tab.

* changed name for stored variables

* minor change

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
@Ayan-10
Copy link
Contributor

Ayan-10 commented Sep 4, 2021

@misaochan @nicolas-raoul I think this issue is not resolved yet. Nearby is still not working without location permission and it also not working if GPS is turned off. Nearby just do nothing if location permission is not there and GPS is not turned on. See this video.

networkCommon.mp4

(The video is a little old but I tested the app on latest master it behaves the same with a endless progressbar)

Tested latest master betaDebug on Samsung J2 API 23 and Pixel 2 emulator API 30

@nicolas-raoul
Copy link
Member

I haven't tried on master, but I just tried on 3.1.0~b41882639:

  1. Remove the app's location permission (in Android apps settings)
  2. Open the Commons app
  3. Tap the Nearby tap
  4. Dialog Requesting Location Permission appears, tap cancel to deny
  5. Spinner spins
  6. I am shown the items nearby London's Tower Bridge

In other words, it seems to work as intended for me.

@Ayan-10 would you mind detailing the steps you are using?

@Ayan-10
Copy link
Contributor

Ayan-10 commented Sep 5, 2021

@nicolas-raoul I tested on both Samsung J2 API 23 and Pixel 2 emulator API 30 devices.

On master

  1. Remove the app's location permission (in Android apps settings)
  2. Open the Commons app
  3. Tap the Nearby tap
  4. Dialog Requesting Location Permission appears, tap cancel to deny
  5. Spinner spins for endless time and nothing is shown.

I waited for 10 minutes but Nearby only showing a spinner spinning.

Also, I noticed that If GPS is turned off It behaves the same way. Only spinner spinning nothing happens.

  1. Make sure the permission is turned on
  2. Turn off GPS
  3. Tap the Nearby tap. (Don't turn on GPS)
  4. A toast popped up saying Nearby might not work properly, Location not available.
  5. Spinner spins for endless time and nothing is shown.

@nicolas-raoul nicolas-raoul reopened this Sep 5, 2021
@Ayan-10
Copy link
Contributor

Ayan-10 commented Sep 5, 2021

@nicolas-raoul So what are expecting from Nearby? I think Nearby should work without location permission and GPS and also Users can add images in any place without location permission and GPS. Users only need to give location permission and GPS when they want to locate themself.

Am I right? Please correct me if I am wrong.

Thanks.

@nicolas-raoul
Copy link
Member

Nearby should work without location permission -> yes

Users can add images in any place without location permission and GPS -> yes

Users who do not have a GPS or do not want to give permission should be allowed to unzoom/pan/zoom to the place they want, and tap Search this area to see places.

@Ayan-10
Copy link
Contributor

Ayan-10 commented Sep 7, 2021

It seems that mapbox is getting null somehow. That's why it's not working without permission.

@sivaraam
Copy link
Member

@Ayan-10 Just trying to figure out what the precise problem you're observing is. Do you see the "Search this area" button when you choose a particular location in the map? If you do see it, do you see no pins even when you zoom to a particular location and use "Search this area" button ?

I'm asking this as Nearby would likely do nothing by default without the location permission when you don't use the "Search this area" button.

Users who do not have a GPS or do not want to give permission should be allowed to unzoom/pan/zoom to the place they want, and tap Search this area to see places.

I tested this on a OnePlus Nord and it appears to be working for me.

@Ayan-10
Copy link
Contributor

Ayan-10 commented Jan 23, 2022

@sivaraam It seems some of the issues that I mentioned here are not occurring now. You can check this comment where I mentioned the issues that were occurring at that time and way of reproducing them in detail.

In the current master, "the nearby tab is not working at all without permission and the spinner just spins" this issue seems to be fixed. Now nearby tab is working as expected (By default it's showing the Tower of London and the pins of the location around that area).

However, "the nearby tab is not working at all without GPS enabled" this issue is still occurring. When I opened the nearby tab without GPS enabled it shows a toast by saying "Nearby might to work properly, Location not available" and after that nothing happens, I can zoom and pan to any place but no pins are showing, no search button is showing.

I hope it should not work like that. Even without the GPS enabled I should be allowed to tap Search this area to see places and see all the location pins in a specific area, and it should already be zoomed to the Tower of London for the first time I open the nearby by default. Moreover, it should work the same as the way nearby is working without permission.

Steps to reproduce the issue

  1. Make sure the permission is turned on
  2. Turn off GPS
  3. Open commons
  4. Tap the Nearby tap. (Don't turn on GPS)
  5. A toast popped up saying Nearby might not work properly, Location not available.
  6. Nearby is not working at all

Can you reproduce it in the same way? I tested the latest master prodDebug on Realme GT master API 30 and the GPS issue is occurring for me.

Thanks

@sivaraam
Copy link
Member

Can you reproduce it in the same way? I tested the latest master prodDebug on Realme GT master API 30 and the GPS issue is occurring for me.

Yeah. With the steps you mention, I do reproduce the issue where the "Search this area" button is not being shown. This is with 3.1.1~1c9267ca0.

So, looks like the app works fine when the location permission itself is not available but fails to show the "Search this area" button if the permission is available but GPS is turned off. Nice catch.

@Ayan-10
Copy link
Contributor

Ayan-10 commented Jan 26, 2022

@sivaraam @nicolas-raoul I have fixed the issue. Can I make the PR?

@nicolas-raoul
Copy link
Member

@Pratham2305 Are you still working on this? I see you are currently assigned. Thanks! :-)

@Pratham2305
Copy link
Contributor

@Pratham2305 Are you still working on this?

Currently No, @Ayan-10 can surely take this since he has already resolved the problem ig :)

@nicolas-raoul
Copy link
Member

@Pratham2305 Thanks for your sportsmanship!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment