I developed a WebService at localhost which is working fine and it is responding on http://localhost/my-web-service/api. So I decided to put it in production to my website (let’s say https://www.mywebsite.com/my-web-service/api).
Now, I would like to test the production api URL installing also the apk to my Android device.
So, in order to build the app, I did “ionic cordova build android” to produce app-debug.apk in the output directory.
The only issue is that I am not able to make this app to point to the production URL.
I’ve read tons of guides and howto on Internet, but still unable to get it working. The only guide that drives me almost to the target is this.
I have also read this one, but still not able to achieve my target.
Basically I would need something like this:
- environment file for development using Chrome on localhost pointing to http://localhost/my-web-service/api
- environment file for testing on my device pointing to https://www.mywebsite.com/my-web-service/api
- environment file for production pointing to https://www.mywebsite.com/my-web-service/api (which I suppose I already have achieved)