I'm using electron and angular 7 for a desktop app.
Trying to use geolocation I got error code:2 but not more detail of error.
I'm using a valid API-key assigned in process.env.GOOGLE_API_KEY
Here is the code example, the only way I manage it to work was simulating my position via developer tools.
navigator.geolocation.getCurrentPosition((pos) => console.log(pos), (err) => console.log(err));
My response is a PositionError object with:
code: 2 message: ""
If i override my position via dev tools, I get a position object with the simulated coords.
Version in package.json
- "electron": "3.0.10",
- "electron-builder": "20.36.2",