Service call does not work in apk ionic


#1

I am having an ionic appliaction with angularjs and REST api for android platform. api services that I am using are hosted on a cloud.

when I launch it with ionic serve it properly calls all services, but when I build apk of that and install it in my phone(wifi is on) and open that, it does not call services. I have pointed to api services correctly because all services are properly called from browser with ionic serve.

previously my apk created at “…/platforms/android/ant-build/android-debug.apk” and all api are properly called from my phone.

But now only I am facing this issue. No my apk is created at “…/platforms/android/build/outputs/apk/android-debug.apk” is ionic upgraded? and because of that i m facing this issue? Please correct me what I missed out


#2

#3

Hey madhuri,
Please try to add to your REST API:

Access-Control-Allow-Origin : *;
Access-Control-Allow-Credentials : true;

I think the problem creates for cross domain access.


Satellizer plugin and oAuth2 Envato API problem
#4

i have added whitelist plugin and it worked… Thanks… :smile:


#5

Thanks a lot. Now I can run on android with Javascript Parse API. :smile: