You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/06/01 13:24:00 UTC

[GitHub] [cordova-electron] aidanas edited a comment on issue #134: navigator.geolocation.getCurrentPosition always respond PositionErrorĀ {code: 2, message: ""} in cordova electron builds.

aidanas edited a comment on issue #134:
URL: https://github.com/apache/cordova-electron/issues/134#issuecomment-636858212


   I get the same issue for builds on MacOS. 
   Interestingly, I was getting same issue on basic plain electron app (no cordova) and the solution was to add your `GOOGLE_API_KEY` to `process.env` within `main.js` file.  (as per [this](https://stackoverflow.com/questions/47955815/how-to-getcurrentposition-via-navigator-geolocation-in-electron-app) SO post)
   `process.env.GOOGLE_API_KEY = 'your key here';`
   However adding the same line to `cdv-electron-main.js` for cordova electron project did not solve the issue. 
   Is there something special Cordova does to `cdv-electron-main.js` file which would make settings `process.env` variables not available? 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org