question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to removeWatcher, missing ID.

See original GitHub issue

This is the error I’m receiving in my Logcat: Line 1 - Msg: Unhandled Promise rejection: Missing id. ; Zone: <root> ; Task: null ;

I’m having trouble removing the watcher on Android (Pixel 4) - I am not using the const id = approach, because I start at one method & end at another method.

Variable declaration at the class level:

clockedOnId: any;

Then in my start method:

this.clockedOnId = BackgroundGeolocation.addWatcher({...

I have attempted several approaches:

Plugins.BackgroundGeolocation.removeWatcher(`${that.clockedOnId}`);
// Plugins.BackgroundGeolocation.removeWatcher(that.clockedOnId);
// BackgroundGeolocation.removeWatcher(that.clockedOnId);

None of which work on Android. On Apple all appears to be well, but it’s harder to tell without the notification sitting in the notification tray. Closing the app seems to be the only desired result.

Any assistance will be appreciated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
diachedeliccommented, Mar 8, 2021

removeWatcher expects an object containing the ID, not the ID itself. Try this:

Plugins.BackgroundGeolocation.removeWatcher({
    id: that.clockedOnId
});
0reactions
diachedeliccommented, Mar 8, 2021

The body of the callback function is the only place you can get location information. What you do with that information is up to you. If ordering is important to you, you might want to look at using WebSockets instead of seperate HTTP requests per location.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot add or remove watcher - K15t Help Center
Solution: Make sure that the Backbone synchronization user has the 'Manage watcher list' and 'View voters and watchers' project permissions and if missing...
Read more >
Unable to Remove watchers - Atlassian Community
Solved: Hi Team, We are facing strange issue with JIRA. We are unable to remove watchers. We have manually removed users from Watchers...
Read more >
Remove a device from Find My on iPhone - Apple Support
Tap Devices at the bottom of the screen, then tap the name of the device you want to remove. Erase the device.
Read more >
Connect IQ Store App: How to Uninstall App Content
Below are steps to uninstall or delete a Connect IQ watch face, device app, data field, widget, or music application from your Garmin...
Read more >
SmarTrip® in Apple Wallet FAQs - WMATA
Adding/Removing a SmarTrip card to iPhone/Apple Watch ... I am unable to transfer my physical SmarTrip card to Apple Wallet.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found