-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Background geolocation doesnt work after closing app #351
Comments
On Android, after user terminates the app, it's impossible to execute the Javascript callback because your entire Cordova app is terminated. Only the plugin's native Android background service remains alive and tracking. This is why it's important to provide an See docs for stopOnTerminate |
thx. so if I add on configure something like : url: "my server url" locations will post to my server? does it work the same on android and IOS? |
Yes. If you observe the plugin's logs with
iOS has the same HTTP service. However, iOS and Android differ in their behaviour with |
thx very much. ill try to do this |
hi once again. i made just like you said but any way it doesnt work on background after closing app. it works perfectly when app in minimized. http request doesnt go to my server in background. what should i do? |
I'm not concerned with what you receive at your server. Do you hear sounds from plugin? "Blip.....blip.....blip...." That means the plugin is alive and recording locations. Are you observing the logs? The plugin is telling you exactly what's going on. |
Do you hear sounds from plugin? "Blip.....blip.....blip...." i dont hear them on background. when i close app its silence). i hear sounds only in foreground |
Are you not curious about what the logs might be saying about that?
On Thu, May 25, 2017 at 7:30 AM vladimircojuhari ***@***.***> wrote:
Do you hear sounds from plugin?
"Blip.....blip.....blip...."
i dont hear them on background. when i close app its silence)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#351 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA6l3bq4nw2kIiHt_93WdSnE5YV9lzOks5r9WZhgaJpZM4NjVDR>
.
--
Snet form Gmail Mobile
|
yeah i am but i dont know how to get them. |
The docs have an entire section called "Logging and Debug"
On Thu, May 25, 2017 at 7:33 AM vladimircojuhari ***@***.***> wrote:
yeah i am but i dont know how to get them.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#351 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA6l43egfBnO2aajlq4kyoNAbfX_xoVks5r9Wb2gaJpZM4NjVDR>
.
--
Snet form Gmail Mobile
|
ok when i get them ill write. thx for answers |
And what about good old Surely your monitoring that? |
this i received on my email. i got 1 email message and its all. should i show you attached file? |
geolocation doesnt work after restarting my divice too |
Are you not watching $ adb logcat?
On Thu, May 25, 2017 at 7:55 AM vladimircojuhari ***@***.***> wrote:
geolocation doesnt work after restarting my divice too
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#351 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAA6l-9lBoLYyYvsF37UzLNs1Hz2hqwgks5r9Ww-gaJpZM4NjVDR>
.
--
Snet form Gmail Mobile
|
yeah i was trying but i cant see anything realted to your plugin |
after closing app |
And what is the last message you see from the plugin in logcat? |
05-25 15:00:26.965 20924 22288 D TSLocationManager: [c.t.l.a.BackgroundGeolocation isMainActivityActive] YES |
also i got this: |
Ignore. show me your |
as you see there are some console.log messages when bgeo is initializied. after this i close app and nothing happens. when initialized: 1 http reqest comes to server, and its all |
does geolocation sending on server works when i dont have license? i just wanted to try before buying license |
Have you read the Philosophy of Operation The plugin is resting in stationary mode and waiting for your device to move.
Now observe what happens when you shake the device vigorously for about 10 seconds. Btw, you can filter
|
The plugin is resting in stationary mode and waiting for your device to move. i installed my app and was walking but result was the same |
At your desk, shake your device and show me the result of |
i closed app and was driving car |
Perhaps you're interested in this line containing a response from your server:
|
Unfortunately, my log formatting doesn't perform well in some locales. They're supposed to be formatted like this:
|
Perhaps you're interested in this line containing a response from your server: i knew this. does 500 error infulence some how? |
so what should i try next?:) can you tell me pls |
I have no control over your server. It is not my concern. My only concern is that the plugin attempted to send a location to your server. With that, my job is done. |
I understand. the problem is not in my server. ok i want to receiver 10 errors from my server. the problem is that the plugin doesnt send anything more then 1 time. |
|
i 05-25 17:00:31.505 1167 1367 I TSLocationManager: { |
when i close app: TSLocationManager: - onPause and nothing happents. i shaked as you said but no result |
Keep shaking for a minute |
as i sad i was driving the car when application was closed and it was connected to notebook and you saw the result. i think it better example than shaking |
Do exactly as I say. |
05-25 17:15:58.072 3162 3162 D TSLocationManager: [c.t.l.d.s.SQLiteLocationDAO unlock] i closed app in another way. this is last rows. during shaking nothing changed |
I don't know. If the Android |
05-25 17:26:52.851 3911 3911 I TSLocationManager: ΓòƒΓöÇ stopOnTerminate: false does this means something. it writes me when i close app by pressing back button on android |
It means your Cordova Javascript app has been completely terminated. None of your Javascript is running; none of your callbacks will fire. Only the plugin's background-service is alive, completely unaffected. Read stopOnTerminate |
any way thx for trying to help me. ill try on other device. but dont think this is the problem |
I test on the following devices. I have no issues with
|
my device is xiomi mi5 (6.0.1) |
Your Environment
Plugin version:2.7.0
Platform: Android
OS version: 6.0
Device manufacturer / model: xiomi mi5
Cordova version (
cordova -v
): 6.5Cordova platform version (
cordova platform ls
):android 6.2.1Plugin config
$ionicPlatform.ready(function () {
var bgGeo = window.BackgroundGeolocation;
//This callback will be executed every time a geolocation is recorded in the background.
var callbackFn = function (location, taskId) {
var coords = location.coords;
var lat = coords.latitude;
var lng = coords.longitude;
svc.addLoadNote(loadId, count++ + ": " + lat + "lon : " + lng);
$scope.load.Notes += "
" + location;
Expected Behavior
execute callback function after closing the app
Actual Behavior
its recording just when app is on foreground. when i close the app it stops working
Steps to Reproduce
Context
Debug logs
The text was updated successfully, but these errors were encountered: