cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cordova-electron] aidanas edited a comment on issue #134: navigator.geolocation.getCurrentPosition always respond PositionErrorĀ {code: 2, message: ""} in cordova electron builds.
Date Mon, 01 Jun 2020 13:33:46 GMT

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 and [this](https://www.electronjs.org/docs/api/environment-variables#google_api_key)
Electron doc)
   `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


Mime
View raw message