Mobile app CORS trouble

I had similar problems. Were my login action works but nothing else. My fix was…

On the CORS option I don’t think the * works. I would just try and get it to work on Android first. To do this change the CORS to http://localhost . Then deploy your app.

Capacitor needs the following:-
image

On the mobile app make sure you have ‘credentials’ ticked. Then run the android emulator and see if this works.

I think the problem is the on the web version of the Capacitor app you also need to put the port on. Problem is the port changes each time the server restarts.

This video goes over it all https://www.youtube.com/watch?v=3YwGbN81Qws&t=2450s around the 19 minute mark.

1 Like