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

Added functionality to determine geolocation coordinates #782

Merged
merged 3 commits into from
Jul 25, 2019

Conversation

fkloes
Copy link
Collaborator

@fkloes fkloes commented Jul 25, 2019

Description

This ticket introduces actions which simplify access to geolocation coordinates.

grantGeolocationPermissions can be used to grant the appropriate app permissions. getGeolocation retrieves the current position of the user. When no permissions where granted yet, it will also prompt the user to enable location services.

Both actions can be imported from @shopgate/engage/core.

Type of change

  • Bug Fix 🐛 (non-breaking change which fixes an issue)
  • Enhancement 🚀 (non-breaking change which adds functionality)
  • Breaking Change 💥 (fix or feature that would cause existing functionality to not work as expected)
  • Polish 💅 (Just some cleanups)
  • Internal 🏠 Only relates to internal processes.

How to test it

Within the development environment you can't test everything all together, since the feature relies on the native browser geolocation functionality and needs an https connection. Since the development apps are served via http, you can only test the code which triggers the permission granting process. In chrome you can test the position determination when you opened Engage via http://localhost

Add this import e.g. to a subscription import { getGeolocation } from '@shopgate/engage/core'; and dispatch the action.

- added request class to fetch the geo coordinates from the device
- moved camera permission logic to the engage package
- added unified action determine one of the possible permissions
- added grantCameraPermissions and grantGeolocationPermissions actions which use the unified one
@fkloes fkloes added the enhancement New feature or request label Jul 25, 2019
@fkloes fkloes self-assigned this Jul 25, 2019
@devbucket devbucket merged commit 7517a30 into v6.8.0 Jul 25, 2019
@devbucket devbucket deleted the PWA-2109-locate-me branch July 25, 2019 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants