Skip to content
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

The functionality stops working when debug config is set to false #97

Open
SanchitSahu opened this issue Dec 22, 2017 · 34 comments
Open

Comments

@SanchitSahu
Copy link

Your Environment

  • Plugin version: Latest
  • Platform: iOS
  • Nativescript version (tns info):
    nativescript │ 3.3.0 │ 3.4.0 │ Update available │
    │ tns-core-modules │ 3.1.1 │ 3.4.0 │ Update available │
    │ tns-android │ 3.2.0 │ 3.4.0 │ Update available │
    │ tns-ios │ 3.3.0 │ 3.4.0 │ Update available │
  • Plugin config:
    BackgroundGeolocation.configure({
    debug: false,
    desiredAccuracy: 0,
    distanceFilter:50,
    stopOnTerminate: false,
    stopOnStationary: false,
    stopTimeout: 100,
    stationaryRadius: 10,
    activityRecognitionInterval: 10,
    preventSuspend:true
    }, (state) => {
    if (!state.enabled) {
    BackgroundGeolocation.start();
    }
    });

Expected Behavior

Should register location events when the app is killed and debug is set to false.

Actual Behavior

Everything works fine when the debug mode is set to true. But setting it to false doesn't do anything when the app is killed. We don't receive the location change updates.

Steps to Reproduce

Just try running with debug initially true and hen set to false

Context

All I am trying to do is get the updates when the user's location updates/changes. I am able to get the updates only when the debug is set to true. I tested out my whole app and once the requirement was fulfilled, I set the debug to false, because obviously, I don't want the notifications and sounds to be popping up on the live app. But once debug is set to false, the entire functionality stops working.

@christocracy
Copy link
Member

When iOS app is killed, your app is terminated. It won't reboot in the background until the device moves at least 200 meters from the last known location.

See this video.

@SanchitSahu
Copy link
Author

If the app doesn't come back when terminates, shouldn't that be same when the debug is set to true? But the app is booted when the app is killed when the debug is set to true.

And as per the doc, I guess the 200meters is for the significantChangesOnly config.

@christocracy
Copy link
Member

debug has nothing to do with your observed issue.

When an iOS app is terminated, your app is terminated. When the device moves at least 200 meters, iOS will reboot your app in the background and the plugin will resume tracking.

No, it's not just useSignificantChangesOnly. Try it in the simulator.

@cmthakkar
Copy link

When we set debug is true, app works perfectly fine across all scenarios including app gets killed or gets into background. When we set debug is false, we expect same behavior but once app gets killed, we don't receive any location update even with actual field test.

Let us know what details we could provide from our side to investigate this issue further.

Thanks

@dipanjan10019
Copy link

dipanjan10019 commented Dec 29, 2017

@christocracy,

Would appreciate if you could please help us with this. We would like to see the same behavior for Debug set to true and false. It works perfectly with debug set to true but when set to false it doesn't. Please let us know if you need any more details from us in order to investigate this. Your help is very much appreciated.

Thanks

@christocracy
Copy link
Member

Here's a test I did today with the demo app running with debug: false. The app was first booted then terminated.

There is NO CHANCE that debug: false affects tracking. None.

@cmthakkar
Copy link

cmthakkar commented Dec 30, 2017 via email

@SanchitSahu
Copy link
Author

@christocracy Wish you a Happy New Year.

Can you let know your availability for next couple of days, so we can get on a call and discuss the next steps? Also, let know the preferred mode of call.

@christocracy
Copy link
Member

I've had the demo app running since Dec 28 with debug: false. I have not touched the app at all. It never fails to track me. Without a doubt, debug has no effect upon tracking.

http://tracker.transistorsoft.com/transistor-nativescript?device=NativeScript-51E45302-F994-4401-A366-4CF733D81EC8&end=2018-1-3&start=2017-12-28

@dipanjan10019
Copy link

@christocracy thanks for getting back to us. Obviously, we are not doing something right. We are not expert NativeScript developers. We are happy to purchase the paid version of the plug-in, but we need your help to resolve this. Would you be open to looking at our code, settings etc. to help us resolve this issue. Thanks

@christocracy
Copy link
Member

Feel free to post what you're doing (ie: your Javascript) in addition to logs from the plugin here. You can fetch logs from the plugin using the #getLog method.

@cmthakkar
Copy link

cmthakkar commented Jan 4, 2018 via email

@christocracy
Copy link
Member

christocracy commented Jan 4, 2018 via email

@cmthakkar
Copy link

cmthakkar commented Jan 4, 2018 via email

@SanchitSahu
Copy link
Author

Hey @christocracy , have given you access to our code repo, should have received an email. The configuration we use it as below:

BackgroundGeolocation.on("location", this.onLocation.bind(this));

    BackgroundGeolocation.configure({
        debug: true,
        desiredAccuracy: 0,
        distanceFilter: 50,
        // activityRecognitionInterval: 10000,
        //useSignificantChangesOnly: true,
        //heartbeatInterval: 60,
        //preventSuspend: true,
        //stopOnTerminate: false,
        // autoSync: true,

        stopOnTerminate: false,
        stopOnStationary: false,
        stopTimeout: 100,
        stationaryRadius: 10,
        activityRecognitionInterval: 10,
        // pausesLocationUpdatesAutomatically:false,


        preventSuspend: true,
        // heartbeatInterval:10

    }, (state) => {
        if (!state.enabled) {
            BackgroundGeolocation.start();
        }
    });

The same can be found in:
HeatCity / blue-dragon-app / app / app.component.ts: Line 287

@christocracy
Copy link
Member

And where are your logs?

@SanchitSahu
Copy link
Author

@SanchitSahu
Copy link
Author

Hey @christocracy , any update on this? Would really appreciate if get any help from you on this.

@christocracy
Copy link
Member

I see nothing unusual in the logs (which came from the simulator).

@cmthakkar
Copy link

cmthakkar commented Jan 8, 2018 via email

@dipanjan10019
Copy link

@christocracy please let us know if we can provide any more details. As mentioned earlier, the plugin works seamlessly in Debug mode, but in Release mode, it doesn't. We are totally stuck and have no idea how to make this work. Your help will be greatly appreciated. Thanks

@christocracy
Copy link
Member

I suggest you test using the demo app

@cmthakkar
Copy link

cmthakkar commented Jan 8, 2018 via email

@christocracy
Copy link
Member

christocracy commented Jan 8, 2018

Then I suggest you provide several days worth of logs from the device (not simulator). Fetch logs with #getLog or #emailLog methods.

  debug: false,
  logLevel: 5

@cmthakkar
Copy link

cmthakkar commented Jan 8, 2018 via email

@christocracy
Copy link
Member

See #getLog.

@SanchitSahu
Copy link
Author

Chris, here are the Device logs when the app was in Foreground and Background.
https://www.dropbox.com/s/zj2scsmc8ofi17n/Background.rtf?dl=0
https://www.dropbox.com/s/95ghnjaqyxv0fxp/Forground.rtf?dl=0

@cmthakkar
Copy link

cmthakkar commented Jan 9, 2018 via email

@christocracy
Copy link
Member

Why are you showing me logs with debug: true? I told you to set it false.

@SanchitSahu
Copy link
Author

@christocracy
Copy link
Member

How can you possibly provide several days worth of logs in 1 hour?

@SanchitSahu
Copy link
Author

These logs are just similar to the ones shared previously, just with the debug set to false just so you can check if you find anything till we share the several days worth of logs

@christocracy
Copy link
Member

The plugin is completely happy in that 2 min of logs.

@cmthakkar
Copy link

cmthakkar commented Jan 10, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants