Ionic serve unable to open url


#1

My developer give me an apk and his code and I want to make changes in some layout.
The apk function wise is working just fine.
However, when use ionic serve, I found that page which related to open url will not work.Try to click it but not responsive

How to fix this?
Or I have missing something?


#2

@bkcollection,

This is very high level description of your issue, try to elaborate it with the actual error or scenario with some screenshots or clips for getting proper help from the community.


#3

example, I click on the news (dark shaded), it will not open, but no error pop out also. It works fine in apk though

This is the screenshot of the ionic serve --lab and also the CORS setting



#4

If you are running it in browser, then open the console of browser, may be you have got some error over there which may be useful in identifying the actual issue.


#5

Thanks
There are errors in chrome console. How shall I fix this?


#6

Hi,
I think your developer used some cordova plugin to open that page or url,
cordova plugin doesn’t work on browser, so you need to check that in devices only.


#7

By looking at error, it seems like you are trying to trigger an event of cordova which is not allowed in browser. Cordova plugins will only work in application inside actual devices and not in browser and that is why you are facing this issue.


#8

is it anyway I can debug it on a pc? anything I shall install?


#9

Nothing that you need to install in your application. But you can not test cordova plugin in browser. Cordova plugins are build for application only not for browser. As an alternative you can share your functionality which you want to achieve at this point so that anyone can suggest the better alternative for browser.


#10

If You want to debug your apk installed on android device,

  1. plug usb cable to pc
  2. enable usb debugging in developer option and set as media transfer in transfer options in android device
  3. Run the app in device
  4. open “chrome://inspect” in pc
  5. in Remote Target area, your app url will come may be “localhost”
  6. click inspect below that url, developer option like console,application,network… same as common chrome developer option will open

In that you can debug your app.


#11

I want to change the html,css files in the url that i want to open.
So as some pages that unable to open, due to same reason I guess.

At least I can make some small changes, view the output of new layout will do.
Simple method is welcome.

Thanks