
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
pg-geolocation
Advanced tools
Get current location in android & ios mobile app
Installing the Cordova CLI
npm install -g cordova
Create the App
cordova create hello com.example.hello HelloWorld
cd hello
Add Platforms
cordova platform add ios
cordova platform add android
Add plugin
cordova plugin add pg-geolocation
cordova plugin add cordova-plugin-add-swift-support --save
onDeviceReady: function() {
app.receivedEvent('deviceready');
geolocation.getgeolocation(
'Geolocation',
function(msg) {
document.getElementById('lat').innerHTML = msg[0].lat;
document.getElementById('lng').innerHTML = msg[1].lng;
},
function(err) {
document.getElementById('lat').innerHTML = err;
}
);
geolocation.getstatus(
'Plugin Ready',
function(msg) {
document.getElementById('deviceready').querySelector('.received').innerHTML = msg;
},
function(err) {
document.getElementById('deviceready').innerHTML = '<p class="event received">' + err + '</p>';
}
);
geolocation.getname(
'Geolocation plugin',
function(msg) {
document.getElementsByTagName('h1')[0].innerHTML = msg;
},
function(err) {
document.getElementsByTagName('h1')[0].innerHTML = err;
}
);
},
<div class="app">
<h1>Apache Cordova</h1>
<div id="deviceready" class="blink">
<p class="event listening">Connecting to Device</p>
<p class="event received">Device is Ready</p>
</div>
<div class="">
<p>Latitude: <span id="lat"></span></p>
<p>Longitude: <span id="lng"></span></p>
</div>
</div>
Build app
cordova build ios
Run app in Xcode
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
Build app
cordova build android
Run app on device
cordova run android
FAQs
Get current location in android & ios mobile app
We found that pg-geolocation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.