npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cordova-plugin-geoq

v2.0.3

Published

GeoQ Cordova Plugin

Readme

GeoQ Plugin para Apache Cordova

Instalación

Después de crear el proyecto Cordova, ejecutar el comando:

cordova plugin add cordova-plugin-geoq

Ya en Javascript iniciaríamos el framework con el siguiente código:

document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady(){
    const geoq = window.plugins.geoq;
    geoq.init('API_KEY',"Title","Description")
        .then(result => console.log('Device ID: ' + result))
        .catch(error => console.error(error));
}

Para hacer todo junto al iniciar podemos usar las promesas:


document.addEventListener('deviceready', onDeviceReady, false);
function onDeviceReady(){
    const geoq = window.plugins.geoq;
    geoq.init(API_KEY)
        .then(result => geoq.activateTracking("Title","Description"))
        .then(result => console.log('Device ID: ' + result))
        .catch(error => console.error(error));
}

API

La librería tiene un API totalmente asincrono y basado en promesas. Esto quiere decir que todas las llamadas del api devuelven una promesa que se puede resolver en un resultado de la llamada o un error. Se accede mediante el objeto window.plugins.geoq.

init(API_KEY,title,description)

Inicializa el framework. Esta llamada debe hacerse desde el método onDeviceReady Parámetros: API_KEY: Es la clave proporcionada para conectarse a GeoQ. Title: (Sólo Android) es el título de la notificación que se mostrará en Android para informar del acceso a la localización. Description: (Sólo Android) es el texto descriptivo de la notificación que se mostrará en Android para informar del acceso a la localización Ejemplo: const geoq = window.plugins.geoq; geoq.init('YOUR_API_KEY','Title','Description') .then(result => {

    console.log('Success: ' + result);
})
.catch(error => console.error(error));

getUserPermission(permiso)

Obtiene el valor del permiso chequeado. Parámetros:

  • permiso: El nombre del permiso a obtener. Tiene los siguientes valores posibles:
    • "permissionTracking": Permiso para el acceso a la localización del usuario.
    • "permissionNotifications": Permiso para recibir notificaciones push por parte de GeoQ Ejemplo: geoq.getUserPermission('permissionTracking') .then ( result => { console.log('Permiso: ' + result); } ) .catch(error => console.error(error));

setUserPermission(permiso,valor)

Establece el valor para el permiso indicado. Parámetros:

  • permiso: El nombre del permiso a establecer. Tiene los valores posibles: "permissionTracking", "permissionNotifications"
  • valor: El valor del permiso establecido. Valores posibles: "true", "false" (como String) Ejemplo: const geoq = window.plugins.geoq; geoq.setUserPermission('permissionTracking','true') .then ( result => { console.log('Permiso: ' + result); } ) .catch(error => console.error(error));

setNotifToken(token)

Permite introducir en GeoQ el token de notificaciones, introducido como string Parámetros:

  • token: El token de notificaciones en formato string Ejemplo: const geoq = window.plugins.geoq; geoq.setNotifToken('TOKEN') .then ( result => { console.log('Permiso: ' + result); } ) .catch(error => console.error(error));

getAdIdWithPermission()

En iOS: Permite realizar la consulta de los permisos de tracking, o devuelve el Advertising Identifier en el caso de que el usuario haya concendido el permiso. En Android devuelve el valor del Advertising Identifier Parámetros:

Ejemplo: const geoq = window.plugins.geoq; geoq.getAdIdWithPermission() .then ( result => { console.log('AdId: ' + result); } ) .catch(error => console.error(error));

getUserProfile()

Permite consultar el perfil de usuario almacenado en la plataforma. Devuelve una colección de pares de valores con claves "name" - "level" Parámetros:

Ejemplo: const geoq = window.plugins.geoq; geoq.getUserProfile() .then ( result => { console.log('Profile: ' + result); } ) .catch(error => console.error(error));

updateExtraData()

Permite almacenar cuantos valores sean necesarios para el usuario para el usuario, utilizando una cadena de valores "clave1:valor1,clave2:valor2...", tantos como sean necesarios Parámetros:

Ejemplo: const geoq = window.plugins.geoq; geoq.updateExtraData('clave1:valor1,clave2:valor2') .then ( result => { console.log('Resultado: ' + result); } ) .catch(error => console.error(error));

updateNotification()

Permite cambiar la notificación necesaria para obtener la localización (para Android, en iOS no tiene efecto) Parámetros:

Ejemplo: const geoq = window.plugins.geoq; geoq.updateNotification('Nueva','Nuevo texto').then( result => { console.log('Resultado: ' + result); }).catch(error => console.error(error));