Open adamlutz opened 2 years ago
BackgroundGeolocation.transistorTrackerParams(device)
you don’t need this method.
see the plugin api docs TransistorAuthorizationToken
Thanks Chris.
Yeah I figured transistorTrackerParams
was not needed and/or no longer supported. I did try the findOrCreateTransistorAuthorizationToken
approach outlined in the api docs, and haven't had luck with it.
I have tried this a few different ways and get an empty access token from the console server:
{"accessToken": "", "expires": -1, "refreshToken": "", "url": "https://xxxxxx.herokuapp.com"}
Server side, I have set the following env vars: SHARED_DASHBOARD=1, ADMIN_TOKEN, JWT_PUBLIC_KEY, and JWT_PRIVATE_KEY... none of these seem to make a difference. And given no token, I'm of course seeing Auth Bearer not found in the server logs:
2022-10-25T00:38:06.266486+00:00 heroku[router]: at=info method=POST path="/api/locations" host=xxxxx.herokuapp.com request_id=6a58ad2d-5a8c-4bc3-aaff-3907de5505ba fwd="98.61.210.86" dyno=web.1 connect=0ms service=16ms status=403 bytes=237 protocol=https
2022-10-25T00:38:06.260778+00:00 app[web.1]: Authorization Bearer not found Error: Authorization Bearer not found
2022-10-25T00:38:06.260792+00:00 app[web.1]: at file:///app/server/libs/utils.js:107:17
Why are you not posting your exact code to `findOrCreateTransistorAuthorizationToken’?
here it is. I can post my entire test component as well if you'd like, but was trying not to overwhelm the thread here.
tracker_host = 'https://xxxxxx.herokuapp.com';
async configure() {
this.setState({
token:
await BackgroundGeolocation.findOrCreateTransistorAuthorizationToken(
'my-org',
'my-username',
this.tracker_host,
),
});
}
and....you got the exact code. Where is the answeer
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
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)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