2

When running my App on Android, I get following Error message when trying to authenticate with the Spotify API (after redirecting back):

net::ERR_CONNECTION_REFUSED (http://localhost/index.html#access_token=...)

Logging in works, but redirecting back to my index.html form Cordova won't.

However, in the config.xml, I've set <content src="http://localhost/index.html" />, so exactly the same URL, just without the other params, and the index.html loads as expected. Even if I copy the URL I'm redirected to (where the error comes from) and paste it as the content src, there is still no error, so it's just the redirection I guess?

I also tried to set localhost to 10.0.0.2, but then I wasn't able to view the index.html

L3N0X
  • 21
  • 1
  • So, for now I've found a pretty bad but working work-around. I open the auth-page with cordova-inappbrowser and add a event listener for errors upon loading a page. When an error appears, the app should just get the loaded url, close inappbrowser and load the url in the webview, which works, since redirecting somehow won't work in webview – L3N0X Feb 19 '23 at 23:03

0 Answers0