Skip to content

Updated documentation for basic params/auth set-up for device + org id? #132

@adamlutz

Description

@adamlutz

First, thank you for getting me up and running in a matter of minutes with your software. I've got a react native background demo app up and running using class components (based of this sample code)

I also have the background-geolocation-console app up and running on Heroku. I can log data to it, however I'm running into similar issues that others have posted regarding not providing the correct parameters as to take advantage of the device filtering dropdown + solve the sql lite errors.

The logs look like this

2022-10-24T23:04:53.495996+00:00 app[web.1]: v1:location:create org:name UNKNOWN org:id undefined device:id undefined
2022-10-24T23:04:53.496109+00:00 app[web.1]: v1:location:create {} {"latitude":37.785834,"longitude":-122.406417,"data":"{\"coords\":{\"speed_accuracy\":-1,\"speed\":-1,\"longitude\":-122.406417,\"floor\":null,\"heading_accuracy\":-1,\"latitude\":37.785834,\"accuracy\":5,\"altitude_accuracy\":-1,\"altitude\":0,\"heading\":-1},\"extras\":{},\"mock\":true,\"is_moving\":false,\"event\":\"motionchange\",\"odometer\":62956.2,\"uuid\":\"61733BA4-F079-47D5-A1B2-FBF69789C8BE\",\"activity\":{\"type\":\"unknown\",\"confidence\":100},\"battery\":{\"level\":-1,\"is_charging\":false},\"timestamp\":\"2022-10-24T23:04:53.246Z\"}","recorded_at":"2022-10-24T23:04:53.246Z","created_at":"2022-10-24T23:04:53.493Z"}
2022-10-24T23:04:53.500741+00:00 app[web.1]: Executing (default): INSERT INTO `locations` (`id`,`latitude`,`longitude`,`data`,`recorded_at`,`created_at`) VALUES (NULL,$1,$2,$3,$4,$5);
2022-10-24T23:04:53.501385+00:00 app[web.1]: <!> Exception WHERE parameter "id" has invalid "undefined" value:  Error: WHERE parameter "id" has invalid "undefined" value

Based on other issues I've read and other comments, I've tried a few things to pass some of the filtering params through like,

  1. passing params to ready() params: BackgroundGeolocation.transistorTrackerParams(device) -- my version of the lib says transistorTrackerParams is deprecated, and going this route doesn't make a difference (the code recommends using the authorizationToken approach here next).

  2. BackgroundGeolocation.findOrCreateTransistorAuthorizationToken -- Unfortunately, I'm unable to create an authentication token going this route (I tried setting the SHARED_DASHBOARD and ADMIN_TOKEN env vars but still was unable to get a token from the server)

{"accessToken": "", "expires": -1, "refreshToken": "", "url": "https://xxxxxxxx.herokuapp.com"}

Wondering if there's something obvious I've overlooked and/or if there might be updated docs you could point me to that might help solve this? Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions