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

When is 'event' equal to 'heartbeat' in the POST schema #257

Closed
svenbw opened this issue Jun 25, 2024 · 8 comments
Closed

When is 'event' equal to 'heartbeat' in the POST schema #257

svenbw opened this issue Jun 25, 2024 · 8 comments
Labels

Comments

@svenbw
Copy link

svenbw commented Jun 25, 2024

In the documentation in the HTTP post schema (see https://transistorsoft.github.io/capacitor-background-geolocation/interfaces/location.html#http-post-schema) event can be set to motionchange, geofence or heartbeat.

However the onHeartbeat function handler will not post data itself when invoked by the plugin (https://transistorsoft.github.io/capacitor-background-geolocation/classes/backgroundgeolocation.html#onheartbeat). If an update must be sent to the server the getCurrentPosition function must be called. Since this is invoked from javascript the event will be missing.

Can anyone give details what the condition(s) are that will set event to heartbeat in the posted server data?

@danillo10
Copy link

Same problem

@christocracy
Copy link
Member

You are free to attach extras to your getCurrentPosition call, attaching any meta data you wish.

@svenbw
Copy link
Author

svenbw commented Jul 22, 2024

We're using the extras already.

My original question was mainly to understand under which conditions the event is set to heartbeat because it's in the documentation listed as a possible option.

@christocracy
Copy link
Member

The docs must be wrong.

@danillo10
Copy link

They work only with app open, if app is closed heartbeat doesnt work

@christocracy
Copy link
Member

if app is closed heartbeat doesnt work

On iOS (nobody has specified iOS vs Android), that’s correct: no heartbeat after terminate. Read api docs Config.stopOnTerminate.

Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 22, 2024
Copy link

github-actions bot commented Sep 5, 2024

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants