Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/03/2017, 00:43
Avatar de alejandrodlrocha
alejandrodlrocha
 
Fecha de Ingreso: abril-2011
Mensajes: 40
Antigüedad: 13 años
Puntos: 1
Respuesta: Es posible mandar notificaciones dependiendo de la ubicación?

Hola, muchas gracias por la respuesta, ya investigué bien y me quedó muy claro.
Al final me topé con este plugin de Cordova:
[URL="https://github.com/cowbell/cordova-plugin-geofence"]https://github.com/cowbell/cordova-plugin-geofence[/URL]

Y al parecer para agregar uno o varios fences nuevos se utiliza esta funcion:
Código PHP:
window.geofence.addOrUpdate({
    
id:             String//A unique identifier of geofence
    
latitude:       Number//Geo latitude of geofence
    
longitude:      Number//Geo longitude of geofence
    
radius:         Number//Radius of geofence in meters
    
transitionTypeNumber//Type of transition 1 - Enter, 2 - Exit, 3 - Both
    
notification: {         //Notification object
        
id:             Number//optional should be integer, id of notification
        
title:          String//Title of notification
        
text:           String//Text of notification
        
smallIcon:      String//Small icon showed in notification area, only res URI
        
icon:           String//icon showed in notification drawer
        
openAppOnClickBoolean,//is main app activity should be opened after clicking on notification
        
vibration:      [Integer], //Optional vibration pattern - see description
        
data:           Object  //Custom object associated with notification
    
}
}).
then(function () {
    
console.log('Geofence successfully added');
}, function (
reason) {
    
console.log('Adding geofence failed'reason);
}); 

O de la siguiente manera (para varios)

Código PHP:
window.geofence.addOrUpdate([geofence1geofence2geofence3]); 
¿Mi pregunta es, puedo agregar fences a partir de un JSON generado remotamente?

Y de nuevo gracias por la respuesta, que bueno es volver a mis orígenes (ForosDelWeb) jaja. Saludos.