-
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
bgGeo.stop not working after terminate the app #751
Comments
i dont call any plugin too in this case |
I don't understand. You already have the solution: $$('.logOut').on('click',function(){
bgGeo.stop(); // <-- #stop on logout.
});
}); |
yes, it working perfectly if im not killed the app after background
geolocation running. i had problem when bgGeo already tracking on the
background, i hear "beep" which post to my server. after that i killed my
app. it perfectly too, background geo still running and i hear sound beep.
but when i reopen my app that i already killed, when i hit logout, and
already logout. the bgGeo still running anytime chris.
…On Thu, Aug 16, 2018 at 8:49 PM Chris Scott ***@***.***> wrote:
I don't understand. You already have the solution:
$$('.logOut').on('click',function(){
bgGeo.stop(); // <-- #stop on logout.
});
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkuCi1IVXG2BXm0Swdpq_49jlZ2sQig2ks5uRXhSgaJpZM4V_Kx->
.
|
Are you watching See Debugging Wiki Show me corresponding logs of what you're talking about. |
no chris,i dont know how to use it. can you giveme the link how to use it?
im not using emulator, im using on the real device.
or maybe because before i stop the bgGeo, i call bgGeo.start() again ? will
it be problem chris ?
…On Thu, Aug 16, 2018 at 9:25 PM Chris Scott ***@***.***> wrote:
Are you watching $ adb logcat -s TSLocationManager?
See Debugging Wiki
<https://github.com/transistorsoft/cordova-background-geolocation-lt/wiki/Debugging>
Show me corresponding logs of what you're talking about.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkuCiwJsGnT3zU5AzLLgZezdm-ToJKFuks5uRYDfgaJpZM4V_Kx->
.
|
08-16 22:50:42.761 24299 24411 I TSLocationManager: This is chris my adblogcat, after bgGeo.start() and tracking already running i hear "beep sound" and then i killed the app. after that i opened my app again to logout whic i had bgGeo.stop(). but the tracking still running on the background, that i think the bgGeo.stop didnt running. |
hello @christocracy , after i change my code, try to make start() after that stop() in my button logout, this plugin worked like a charm, but if i killed the app when start() which in the log is CDVBackgroundGeolocation#onDestroy , and i open the app again. i cant stop the background geolocation.
Please @christocracy help me. i need to solve this problem. Thankyou Chris. |
Show me the javascript you're using to control the plugin. |
Here is my javascript code @christocracy :
Anything fine i can stop bgGeo if im not killed the app. |
Are you checking the JavaScript console for errors? |
i'm checking in my mozzilla firefox console only when there is no background geolocation plugin. and anything fine @christocracy . or maybe you can recommend me some trick to know what is my problem? |
Chris i follow your trick, i inspect and only this after i killed the app, it will terminate the inspect devices. |
if im not killed the app, the background geolocation can stop tracking instantly @christocracy . in this case start tracking and logout. |
hi @christocracy, there is error in my function. but after fix it, it still the same. backgroundGeolocation cant stop if i killed the app. |
@christocracy i try to make a new javascript to try your plugin again. its all my javascript code. still the same, if im not killed the app, i can stop the tracking. but if im killed the app, and open again my app, i cant stop the plugin. |
Do you understand what this does:
|
i think stopterminate false to still tracking when the user kill/terminate
the app right? or i am wrong ?
i want to stop tracking after i killed the app and reopen the app and klik
logout chris. is anything wrong with my code?
…On Sun, Aug 19, 2018, 7:41 PM Chris Scott ***@***.***> wrote:
Do you understand what this does:
stopOnTerminate: false
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkuCi-c4yCBJhiS9kjtPRi-vzo83-_F0ks5uSVzkgaJpZM4V_Kx->
.
|
Sorry, this statement is correct. |
i want the tracking still running on the background when i terminate or
kill the app, so i use stopontetminate false, so when i kill the app the
tracking still running on the background like i wanted. but after i re-open
the app and then i click logout button the tracking still running and dont
want to stop, what must i do chris?
…On Sun, Aug 19, 2018, 9:31 PM Chris Scott ***@***.***> wrote:
i think stopterminate false to still tracking when the user kill/terminate
the app right? or i am wrong ?
You are *wrong*.
think about it carefully. read it to your self: "Do I want the plugin to
stop when app terminates?" true or false?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkuCiyIeYRLEwndspqgkyQ1CLiC31f29ks5uSXbBgaJpZM4V_Kx->
.
|
You are not supposed to do this: bgGeo.ready({
.
. // <-- your config.
.
}, function(state) {
console.log("BackgroundGeolocation ready: ", state);
});
bgGeo.start(); // <--------------- NO! You must NOT attempt to bgGeo.ready(config, function(state) {
// The plugin remembers its enabled status between reboots.
// it will have automatically executed #start upon itself here if it was last terminated while enabled.
// You do not have to manually #start the plugin.
}); |
ok chris, i already test what you said, so i change my code like this js like this
when i killed the app and open the app again, i klik btnStop which have bgGeo.stop() |
Why?? function(state) {
if (!state.enabled) {
bgGeo.start(function() {
console.log('- BackgroundGeolocation tracking started');
});
} This will ensure the plugin is always |
As I wrote above: bgGeo.ready(config, function(state) {
// The plugin remembers its enabled status between reboots.
// it will have **automatically executed #start upon itself here**
// if it was last terminated while enabled.
// You do NOT have to manually #start the plugin.
}); |
and then where must i give bgGeo.start() or the bgGeo.ready @christocracy ? in that case, i only ready if i click login button. but for testing, i make stop button in the index.html. so when i reboot, my app will open index.html and i click stop button, not login button. it just for testing |
From your user interface eg: |
ah @christocracy you mean like this right ?? |
// You do NOT have to place the *listener* inside `#ready`
$$('.btnStop').on('click',function(){
bgGeo.stop();
});
$$('.btnStart').on('click',function(){
bgGeo.start();
});
bgGeo.ready(config, function(state) {
// you do not need to do anything here.
}); |
i already test this chris, why it still wont stop ? |
Delete your app from the device. See if you can still gather logs / hear debug sounds. |
yes i already test it too @christocracy i delete and im not hear debug sounds, and the logcat not showing anything |
Here is the fresh log, after i install, click login for start, and then the destroy/ kill the app. reopened the app and then click stop. still no luck tracking still running.
|
Here is the javascript code @christocracy |
With the plugin in this state (ie: stopped).
Show me the logs. |
in config ready ? |
I don't know what you mean. Don't change anything. With your app "Logged out", perform the steps above. |
do you mean this ? after click bgGeo.stop() |
Reboot your device and try again. |
still no luck @christocracy, tracking still running |
the log is after reboot my device. i do the same thing. after stop, terminate/killed the app and open the app again. still no luck. |
@christocracy after i change my code like this
and still cant be stopped. whats wrong @christocracy |
@christocracy sometimes stop sometimes not stop. i think it can be stopped after ready call the start again, or restart the tracking. i see the on the top of the screen white, and then gone. after that i hear sound like start tracking. after the plugin restart, then i click stop button. it can be stopped perfectly. how to fix this ? |
oh i think because the reset:true @christocracy |
@christocracy i see the docs you wrote is
so will this be problem if i usethis
sorry navigator will change use your plugin, i have not changed yet :( |
Yes, it will be a problem. Never attempt to use |
Add a setTimeout(function() {
bgGeo.stop();
}, 1000); |
oh ok. i want to use latitude and long when someone click button transaction. so in that listener i call bgGeo.getcurrentposition right ? so it will not be a problem? and still use my config, only delete reset:true. why when first boot bgGeo.start run, i hear "beep" sound, and i try to kill the app with driving, why the tracking not runnng ? but if im not killed the app it will running. if the background already running, and i killed the app, there is no problem with the background. |
You need to provide logs. |
use set timeout for prevent the bgGeo.stop before ready ? |
In your logout action. function cobaStop(){
setTimeout(function() {
bgGeo.stop();
myApp.dialog.alert("stopped");
}, 1000);
}
You can use |
so i call the watchposition on my deviceready right ? |
You do not use ANY
The plugin automatically |
oh get it. then i call watchposition on login click with bgGeo.start right ? if i add listener for background to stopwatchposition, so when resume it must be bgGeo.watchposition again? |
bgGeo.start(function() {
// in the callback to #start
bgGeo.watchPostiion(...)
});
Yes. |
ok Chris, i think i get it how thenplugin works. i will try it tommorrow then. thankyou for helping me, you made my day Chris. and i will make new issues i think after providing log about the problem the tracking not running when first to bootig . once again, Thankyou Chris! AWESOME PLUGIN |
I'm closing this issue. it's too long now. |
yes chris thankyou, i will make new issues tommorrow
…On Mon, Aug 20, 2018 at 9:25 PM Chris Scott ***@***.***> wrote:
I'm closing this issue. it's too long now.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#751 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AkuCi461yCt82-u0G3imPFaZMorg6NdNks5uSsa_gaJpZM4V_Kx->
.
|
Your Environment
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova -v
): 8.0.0cordova platform ls
):cordova-background-geolocation-lt 2.12.1 "BackgroundGeolocation"
cordova-plugin-background-fetch 5.4.1 "CDVBackgroundFetch"
cordova-plugin-camera 4.0.2 "Camera"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-whitelist 1.3.3 "Whitelist"
Expected Behavior
when open the app the i hear sound beep for the first time. when i close the app(backgorund) i hear sound like telolet which tracking on the background run perfectly. i give bgGeo.stop on my logout button when i hit it, the plugin is perfectly stop. that case if i dont killed the app when i already hear the telolet sound.
Actual Behavior
I want if background tracking already running, i killed the app which there is GPS logo on top of the device that running and i still hear beep, beep beep. then i want open my app again and hit logout and the background stop. How can i do that ? (i can do this if im not killed the app after telolet sound)
Steps to Reproduce
Context
Debug logs
The text was updated successfully, but these errors were encountered: