Skip to content

[Bug]: LocationTemplate does not match HTTP Request Body #2586

@MajStc

Description

@MajStc

Required Reading

  • Confirmed

Plugin Version

5.1.1

Mobile operating-system(s)

  • iOS
  • Android

Device Manufacturer(s) and Model(s)

Samsung Galaxy S21 5G

Device operating-systems(s)

Android 15

React Native / Expo version

Expo 53

What happened?

BackgroundLocation HTTP Client sends data that looks different from what I configured it to be

Plugin Code and/or Config

persistence: {
        locationTemplate:
          '{"recordedAt":"<%= timestamp %>","lat":<%= latitude %>,"lng":<%= longitude %>,"accuracy":<%= accuracy %>,"heading":<%= heading %>,"speed":<%= speed %>}',
        maxRecordsToPersist: 10_000,
        maxDaysToPersist: 1,
        persistMode: BackgroundGeolocation.PersistMode.Location,
        timestampFormat: 'epoch',
      },


Request body sent


{
  "locations": [
    {
      "recordedAt": "2026-05-18T12:23:11.983Z",
      "lat": 51.12160674789624,
      "lng": 17.03080392654926,
      "accuracy": 2.92,
      "heading": 349.44,
      "speed": 13.89,
      "mock": true
    },
  ]
}


Expected recorderAt to be epoch and to not include mock field

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions