Dear Development Team,
I’m facing this problem from last 2 months while testing it on android device, and i think many developers like me is facing the same.
I request you to please resolve this and give us a solution.
Below is my code -
this.geofence.initialize().then(() =>{
alert('Geofence Plugin Ready')
this.addGeofence()
},(err) => {
alert(err)
})
addGeofence(){
let fence = [
{
id: 'enter',
latitude: 28.6016271,
longitude: 77.3519364,
radius: 500,
transitionType: 1,
notification: {
id: 1,
title: 'You crossed a fence',
text: 'You just arrived XYZ',
openAppOnClick: true
}
},{
id: 'exit',
latitude: 28.6016271,
longitude: 77.3519364,
radius: 500,
transitionType: 2,
notification: {
id: 2,
title: 'You crossed a fence',
text: 'You just left XYZ',
openAppOnClick: true
}
} ]
this.geofence.addOrUpdate(fence).then(
() => alert('Geofence added'),
(err) => console.log('Geofence failed to add')
)
this.geofence.getWatched().then(
(res) => console.log('Geofence Watching ::' + res),
(err) => console.log('Geofence Error is : ' + err)
)
this.geofence.onTransitionReceived().subscribe((resp) => {
// this.number = this.number + 1;
console.log("geofence on transition received");
},(err) =>{
alert('error'+err)
})
}
I am using ionic version 3.20.0
Please HELP