Closed nanshaki closed 1 month ago
This is what your server said to the plugin:
[HttpService$i onResponse] ⚠️ Response: 401,
Hi Thank you for your response. However the server does not say this on IOS Same setup. Happens only in the background. In foreground the app tracks fine and url is found Any clues?
The only reason your server would return 401 is that it's not satisfied with the provided auth credentials.
You should debug this at your server and log the provided credentials.
I am a little confused by the process on Android. Would you mind giving me a quick rundown on the process:
Why would the access token (Our authentication credential) be invalid on Android while it works fine on IOS
Thank you!
You are placing your auth token in the http headers. Both iOS and Android operate identically.
Presumably, your server is not happy with that token associated with that particular device.
Query your server logs to find out why.
Hello again We think that we understand the issue on Android now better. We are using Access tokens and Refresh Tokens when the Access tokens expire within a set amount of time. However the onHTTP is not triggering and I see why that is from this post. https://github.com/transistorsoft/react-native-background-geolocation/issues/710
Android Headless Mode for Cordova https://github.com/transistorsoft/cordova-background-geolocation-lt/wiki/Android-Headless-Mode
Why do you reference the React Native version? You are posting here on the Cordova version.
For Cordova, you must reference the Android Headless Mode in the Wiki here.
Cordova users must write their Android headless code using Java, unlike React Native which allows headless code to be written in Javascript.
Also search the API docs here for "Config.authorization".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Your Environment
cordova -v
): 10cordova platform ls
): 10.1.1#ready
: