You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am posting this here and not as an issuse as I am unable to provide a reproduction environment.
maybe someone else would be able to do that or mabye it will just help someone else with the same issue.
Anyway,
I was using a combination of usePermission together with useGeolocation and encountered the following scenario:
I am using a PWA and when the phone owner had the location services turned off
geoPermissionsState.value was 'propmt' which is o.k..
Seeing that this was the situation I was calling resume() following some explaining to the user and him pressing a button.
This brought up a notification for the user prompitng him to turn on his location services.
Even though the user did just that, the value of geoPermissionState.value remained 'prompt'.
This is in contrast with the more standard scenario where location services are turned on and the user has not yet provided permission in which case the users consent to share his location results in the geoPermissionState.value changing to 'granted' as expected.
I have than discovered that though geoPermissionState.value remained 'prompt' - The coords.latitude did start to provide the expected data - so I modified my logic to react not only to a change in the reported permissions but also to a change in the coords and was able to circumvent the issue.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am posting this here and not as an issuse as I am unable to provide a reproduction environment.
maybe someone else would be able to do that or mabye it will just help someone else with the same issue.
Anyway,
I was using a combination of usePermission together with useGeolocation and encountered the following scenario:
I am using a PWA and when the phone owner had the location services turned off
my code initializes like this:
geoPermissionsState.value
was 'propmt' which is o.k..Seeing that this was the situation I was calling resume() following some explaining to the user and him pressing a button.
This brought up a notification for the user prompitng him to turn on his location services.
Even though the user did just that, the value of
geoPermissionState.value
remained 'prompt'.This is in contrast with the more standard scenario where location services are turned on and the user has not yet provided permission in which case the users consent to share his location results in the
geoPermissionState.value
changing to 'granted' as expected.I have than discovered that though
geoPermissionState.value
remained 'prompt' - Thecoords.latitude
did start to provide the expected data - so I modified my logic to react not only to a change in the reported permissions but also to a change in the coords and was able to circumvent the issue.Beta Was this translation helpful? Give feedback.
All reactions