Closed kushal-ost closed 5 years ago
I am using paid license key
If you are a customer, you’re aware you’re posting issues to the public repo?
yes.. Any problem ?
Can you suggest why BackgroundGeolocation.on('http', callback ) is not working ?
On vacation until July 23
okay
When I return, those issues posted to the private repo are going to be attended to first, before those posted here in the public repo.
okay.. no issue
Can you please tell me, is it possible with your plugin or not ? That if I add any geofence then can it trigger any event by the response from adding geofence ? If it is possible caan you suggest how ? It is Urgent.
@kushal-ost If you read the documentation, you could see that there are already events to listen to.
Use the geofenceschange
event to get notified in case of changes in the monitored geofences. Use the geofence
event to get notified in case someone crosses a geofence.
Hi,
When I add a geofence then I don't get any notification of entering into geofence (If using licence key). With same code , when I am not using licence key, I get notification of adding geofence.
This is because http function does not work.
bgGeo.on('http', function(response) {
console.log('res: ', response);
}, function(response) {
var status = response.status;
var responseText = response.responseText;
console.log("- HTTP failure: ", status, responseText);
})
I am not able to get console anything inside http function.
Please suggest.
post logs from the plugin. See wiki “Debugging”.
I cannot help you without logs.
Do not pollute the thread with long logs. Attach as file.
(Your last comment has been deleted)
Please find the attached log, when I open the app. I do not get the log when I add the geofence. log.txt
What are all these #getCurrentPosition
requests in the logs from?
Verify your license is correctly installed by viewing wiki "License Validation Failure"
Yes... Licence is correct.
Current position is showing correct position.. but http is not working. Please help
Paste your entire AndroidManifest.xml.
why are you executing so many current position requests??
Issue is that when I add any geofence then i am not able to get response in bgGeo.on('http', function(response) { .... } Although my server returns id in response when any geofence is added.
Please help me out in this.
Please stop saying “please help” and answer the questions I ask.
This is the 3rd time I’ve asked: why are you executing getCurrentPosition so many times??
I m using getCurrentposition to refresh latitude n latitude after fix interval of time. I m using setTimeInterval
How to check whether the url in bgGeo.ready is working or not using this plugin ? i think I am not getting the response from this.
I see nothing in your logs showing you’re monitoring any geofences.
please check this log... This log comes when I open the app
Is there any method to test whether the url in bgGeo.ready() is providing any response or not ?
Your logs do not show any geofence events so you should not expect HTTP events.
Then how to correct this ?
I don't know what your problem is.
My issue is that : When i add any geofence then I should get response from the url which I am using in bgGeo.ready{ ..url:"http://www.childfinda.com/process/geofence.php",... } and the basis of this response I want to call any function.
From postman , I am able to get response of this url, but using this plugin I am not able to console response of bgGeo.on('http', function(response) { ... }
Like I said:
Your logs do not show any geofence events so you should not expect HTTP events.
Do you see any geofence events occurring in your logs? I don't. Why should you expect to see an http event from a geofence event which has not fired?
I already told you that log was of when my app just opened. When I add any geofence then I am getting an array of geofence.
When I add any geofence then I am getting an array of geofence.
An array of geofences from what?
Now you can see geofence: Please find the log Like I have "My place" as geofence geofence_log.txt
You're not answering my questions
An array of geofences from what?
Like I have "My place" as geofence
Yes, fine. So you've added a geofence. I don't see that geofence event firing (ie: exit / enter)
Array of geofence from my server..
I am creating geofence of the same area where I am present.. So it should fire event of enter/exit.. But it does not.
I am using:
bgGeo.on('geofence', function(geofence) { var location = geofence.location; var identifier = geofence.identifier; var action = geofence.action; console.log('A geofence has been crossed: ', identifier); console.log('ENTER or EXIT?: ', action); console.log('geofence: ', JSON.stringify(geofence)); });
But it do not console anything.
BackgroundGeolocation.addGeofence({ identifier: place.placeName, radius: place.placeGPSradius, latitude: place.placeGPSlat, longitude: place.placeGPSlong, notifyOnEntry: $scope.geofence.notifyOnEntry, notifyOnExit: $scope.geofence.notifyOnExit, notifyOnDwell: false, loiteringDelay: 30000, // 30 seconds extras: { // Optional arbitrary meta-data place_id: place.place_id, circleToken: place.circleToken, userId: $localStorage.userMaster.id } }
Show me the config {}
you're providing to #ready
bgGeo.ready({
// Geolocation config
desiredAccuracy: 0,
distanceFilter: 10,
stationaryRadius: 25,
// Activity Recognition config
activityRecognitionInterval: 10000,
stopTimeout: 5,
// Application config
debug: true, // <-- Debug sounds & notifications.
reset:true,
stopOnTerminate: false,
startOnBoot: true,
// HTTP / SQLite config
method: "POST",
autoSync: true,
maxDaysToPersist: 3,
url:"http://www.childfinda.com/process/geofence.php",
params: {
user_id: $localStorage.userMaster.id,
},
headers: {
'Authorization': $localStorage.apiAccessToken,
'Content-Type' : 'application/json'
}
}, function(state) {
// This callback is executed when the plugin is ready to use.
console.log("BackgroundGeolocation ready: ", state);
if (!state.enabled) {
bgGeo.start();
}
});
You don't think you might want LOG_LEVEL_VERBOSE
when having problems, as mentioned in Wiki Debugging?
Add logLevel: bgGeo.LOG_LEVEL_VERBOSE
Now fetch more logs.
Please find the updated log
Now that you've provided VERBOSE
logs, I see a geofence event fired with 3 successful HTTP requests.
07-30 19:27:03.981 DEBUG [TSGeofenceManager a]
╔═════════════════════════════════════════════
║ TSGeofenceManager found 3/3 within 1000 meters
╠═════════════════════════════════════════════
╟─ 🎾 My place
╟─ 🎾 school
╟─ 🎾 new place
╚═════════════════════════════════════════════
07-30 19:27:04.467 INFO [GeofenceService onHandleIntent]
╔═════════════════════════════════════════════
║ Geofencing Event: ENTER
╠═════════════════════════════════════════════
╟─ new place
╟─ school
╟─ My place
╚═════════════════════════════════════════════
07-30 19:27:04.507 DEBUG [TSLocationManager a] 23.536
07-30 19:27:04.559 INFO [c persist]
✅ INSERT: 44e81abb-368f-4065-a488-a79231546f75
07-30 19:27:04.601 DEBUG [HttpService flush]
╔═════════════════════════════════════════════
║ HTTP Service
╠═════════════════════════════════════════════
07-30 19:27:04.620 INFO [c persist]
✅ INSERT: 6a2da7eb-9eca-4788-85cc-b505b3d05019
07-30 19:27:04.699 DEBUG [c first]
✅ Locked 1 records
07-30 19:27:04.713 INFO [HttpService a]
🔵 HTTP POST: 44e81abb-368f-4065-a488-a79231546f75
07-30 19:27:04.713 INFO [c persist]
✅ INSERT: 8055db15-15bc-47b0-8ca1-2384077b6ca6
07-30 19:27:04.814 WARN [BackgroundGeolocation$i run]
⚠️ HTTPService IS BUSY. This probably should not run!
07-30 19:27:04.815 WARN [BackgroundGeolocation$i run]
⚠️ HTTPService IS BUSY. This probably should not run!
07-30 19:27:05.152 INFO [HttpService$a onResponse]
🔵 Response: 200
07-30 19:27:05.174 DEBUG [c destroy]
✅ DESTROY: 44e81abb-368f-4065-a488-a79231546f75
07-30 19:27:05.242 DEBUG [c first]
✅ Locked 1 records
07-30 19:27:05.262 INFO [HttpService a]
🔵 HTTP POST: 6a2da7eb-9eca-4788-85cc-b505b3d05019
07-30 19:27:05.548 INFO [HttpService$a onResponse]
🔵 Response: 200
07-30 19:27:05.652 DEBUG [c destroy]
✅ DESTROY: 6a2da7eb-9eca-4788-85cc-b505b3d05019
07-30 19:27:05.910 DEBUG [c first]
✅ Locked 1 records
07-30 19:27:06.042 INFO [HttpService a]
🔵 HTTP POST: 8055db15-15bc-47b0-8ca1-2384077b6ca6
07-30 19:27:06.522 INFO [HttpService$a onResponse]
🔵 Response: 200
07-30 19:27:06.725 DEBUG [c destroy]
✅ DESTROY: 8055db15-15bc-47b0-8ca1-2384077b6ca6
07-30 19:27:21.296 INFO [a a]
My bgGeo.on('geofenceschange', function(event) { } is woking.. but bgGeo.on('geofence', function(geofence) { } is not working..
also bgGeo.on('http', function(response) { } is not working..
What may be the reason ?
Please find the attached log. My geofence is "My new school" newlog.txt
What's the status on this issue?
Hi, I have one issue in this plugin integrating with app. Please understand one scenario. Geofence is created by first device (PARENT) and if second device (CHILD) crosses that geofence then first device should get notified about entry/exit of CHILD.
What event should I use to track geofence is crossed or not?
Plugin version: 2.12.2 Platform: iOS or Android : Both OS version: Latest Device manufacturer / model: Any device of android / iOS Cordova version (cordova -v): 8.0.0 Cordova platform version (cordova platform ls): Andriud- 7.0.0 IONIC VERSION : IONIC v1
Expected Behavior
It should provide response when geofence is added.
Actual Behavior
Nothinig event is fired when geofence is added.