ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
11.24k stars 955 forks source link

Http Plugin Capacitor Not working in android & ios #7437

Closed danaabhi closed 2 weeks ago

danaabhi commented 2 weeks ago

Capacitor Version

npx cap doctor Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 6.0.0 @capacitor/core: 6.0.0 @capacitor/android: 6.0.0 @capacitor/ios: 6.0.0

Installed Dependencies:

@capacitor/cli: 6.0.0 @capacitor/android: 6.0.0 @capacitor/core: 6.0.0 @capacitor/ios: 6.0.0

[success] Android looking great! 👌

Other API Details

npm --version
10.5.0

node --version
v20.12.1

Platforms Affected

Current Behavior

const headers: HttpHeaders = { 'accept': 'application/json', 'authorization': Bearer ${accessToken}, 'content-type': 'application/json', };

When using following its works in web but in native its giving error as 401 Unauthorized, even check in native its passing bearer token as well but its giving error

WWW-Authenticate : "Bearer realm=\"production\",error=\"invalid token\""

Expected Behavior

It should work same in all platform

Project Reproduction

NA

Additional Information

No response

ionitron-bot[bot] commented 2 weeks ago

This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙