I\'m trying to build a small application on Nativescript-vue
where I\'m having backend laravel
framework for api calls which needs to be called to get
I tested the exact same project you have shared in Github with Android 8.0, it works perfectly fine. The axios call hits the error block as the response status (error.response.status
) is 401 and data (error.response.data
) returns the exact same response you see from Postman.
If you are using Android 9 or later it might fail as you haven't enabled useCleartextTraffic
on your application
tag in the AndroidManifest.xml
.
With iOS also it would fail as you haven't enabled app transport security. Just to allow all Http communication within your app, you have to add the following key to your info.plist
NSAppTransportSecurity
NSAllowsArbitraryLoads
In case if you want to allow only specific domains, then use NSExceptionDomains
key and list the endpoints.